我有一个 AjaxFallbackDefaultDataTable
,其中每个测试结果都有一行。测试结果可能会有附带的注释,需要在测试结果下方突出显示,希望得到类似于以下表格的效果:
| Test | Result | Appraisal |
|------|--------|-----------|
| 1 | 20.0 | PASS |
| 2 | 1.50 | FAIL |
| Note: This is an epic fail|
| 3 | 19.4 | PASS |
| 4 | 14.9 | PASS |
有没有办法使用Wicket DataTable构造实现此行插入(最好是具有列跨度)。当我深入挖掘源代码时,我可以找到Item
渲染器,但没有处理行的内容。
目前我有以下内容:
// Create the sortable data provider.
SortableDataProvider<TestResult> provider = new SortableDataProvider<TestResult>() {
//... hibernate pagination code ...
};
List<IColumn> columns = new ArrayList<IColumn>();
columns.add(new TextFilteredPropertyColumn(new Model<String>("Test"), "test", "test"));
columns.add(new TextFilteredPropertyColumn(new Model<String>("Result"), "result", "result"));
columns.add(new TextFilteredPropertyColumn(new Model<String>("Appraisal"), "appraisal", "appraisal"));
// Create a new AJAX table using the sortable, filtered data provider.
final AjaxFallbackDefaultDataTable dataTable = new AjaxFallbackDefaultDataTable("testResultTable", columns.toArray(new IColumn[0]), provider, 20);// 20 = number of rows per page