DefaultDataTable uses a HeadersToolbar, which renders sortable headers *if* a column is sortable. For that the column has to return true from #isSortable() .

PropertyColumn supports sorting, but for that you have to provide a sortProperty. Note the third constructor argument:

columns.add(new PropertyColumn<Contact, String>(new Model<String>("Last Name"), "lastName", "lastName")

Hope this helps

On 01/20/2013 01:35 PM, Lucio Crusca wrote:
Hello *,

I'm trying to understand repeaters and DataTable from WicketExamples. I'm
definitely having a hard time...

The running example shows a nice table with sorting column headers. However
looking at what pretends to be the corresponding source code, I can't find
where the DataTablePage code adds the sorting table headers, nor where any
third parties eventually refer to both DataTablePage and SortingPage, the
latter being the only place where I see the headers being added. Likewise,
DataTablePage is the only place where I see the CSV exporter being added, but
the running example has both sorting columns and CSV exporter in the same

I've tried copying in my application and adapting it, but (as
expected) the resulting table has no sorting headers, though it does use a
SortableDataProvider (same provider being used by SortingPage).

Please help...

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to