tags:

views:

45

answers:

1

I am creating table with AjaxFallbackDefaultDataTable. I want to add image to each column and when user clicks any column for sorting, I want to change this image.

Is this is possible?

+3  A: 

This is probably best handled by css.

If you look at this example of an AjaxFallbackDefaultDataTable, you'll note that with no work at all, the headers change background color when clicked.

This happens because of wicket-defined css classes "wicket_orderUp", "wicket_orderDown", and "wicket_orderNone" on the header set by the callbacks when you click on columns, and some default css supplied by wicket.

If you create css that sets a background image for these classes, possibly qualified by other css hierarchy if you don't want it everywhere, you should be able to get changing images with no Java code.

Don Roby
You are right, I am able to add images now to the header. I have added .wicket_orderUp, .wicket_orderDown, .wicket_orderNone properties in my own css file. Thanks for the help.
goutham
I have another question, If I want to make the complete column header as clickable, how do I do that. That is, currently it supports only clicking on column name, but I want to have option to click anywhere on that table column header for sorting. I will post new question for this.
goutham