I wish to add subrows to my DataTable (as done in How to insert 'sub-rows' into a Wicket DataTable), but I'd like to go a step further and add my own custom wicket components within the added html for the sub-row. Since the extra HTML in that question was added in the onRender it's always too late to add components. Is there another way to add the markup and Wicket components as a sub-row of a DataTable?
Asked
Active
Viewed 1,546 times
1 Answers
4
Use an AbstractColumn
instead of a PropertyColumn
. For example:
columns.put(new AbstractColumn<TestResult>(new Model<String>("test column")) {
@Override
public void populateItem(Item<ICellPopulator<TestResult>> cellItem, String componentId, IModel<TestResult> rowModel) {
cellItem.add(new MyComponent(componentId));
}
});

schmimd04
- 1,444
- 3
- 14
- 23
-
1I actually ended up using wicket fragments for each row, but this seems to work too. – psicopoo May 14 '12 at 16:20
-
Could you please describe your solution with fragments? I am facing a similar problem. – mmm Jun 09 '13 at 02:53
-
I think this is not valid answer as this inserts another
into data table, resulting in inside – Foyta Apr 12 '16 at 07:58