tags:

views:

165

answers:

1

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  A: 

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.

schmimd04