开发者

How do you make a link inside a PropertyColumn in Wicket?

开发者 https://www.devze.com 2022-12-28 16:41 出处:网络
I suc开发者_高级运维cessfully made an AjaxFallbackDefaultDataTable, but I want to make the contents of the cells links.How do I do this with Apache Wicket?You can use an AbstractColumn instead of a Pr

I suc开发者_高级运维cessfully made an AjaxFallbackDefaultDataTable, but I want to make the contents of the cells links. How do I do this with Apache Wicket?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消