Due to a ransomware attack, the wiki was reverted to a July 2022 version. . We apologize for the lack of a more recent valid backup.
...
Code Block | ||
---|---|---|
| ||
@Override protected void populateTable(TableModel tm, ObjectNode payload) { // ... List<Item> items = getItems(); for (Item item: items) { populateRow(tm.addRow(), item); } } private void populateRow(TableModel.Row row, Item item) { row.cell(ID, item.id()) .cell(LABEL, item.label()) .cell(CODE, item.code()); } |
Note the payload parameter; this allows contextual information to be passed in the request, if desired.
The sample table uses fake data for demonstration purposes. A more realistic implementation would use one or more services to obtain the required data. The device table, for example, has an implementation something like this:
...