I successfully made an AjaxFallbackDefaultDataTable, but I want to make the contents of the cells links. How do I do this with Apache Wicket?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use an AbstractColumn
instead of a PropertyColumn
. This will allow you to add whatever component you like, rather than just the string value of the PropertyModel.
columns.add(new AbstractColumn("displayModel", "sortModel") {
void populateItem(Item cellItem, String componentId, IModel rowModel) {
cellItem.add(new LinkPanel(componentId, rowModel));
}
}
Where LinkPanel
is the component you want to add in the cell.