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

I have successfully created AjaxFallbackDefaultDataTable but want to render the contents of the cell references. How can I do this using Apache Wicket?

+2


a source to share


1 answer


You can use AbstractColumn

instead PropertyColumn

. This will allow you to add any component you like, not just the string PropertyModel value.

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 to the cell.

+7


a source







All Articles