add listener to table header

how do i add a listener to a table header?

Could you please be a bit more descriptive with your question. What are you exactly trying to do? What events do you want to listen to? What is your use case?

i would like to add a click listener so that when the user clicks on the table header an event happen

Adding click listeners to the Table header is currently not supported.

However this feature will be available in Vaadin 6.4 so please stay tuned :wink:


I did a hack to get an sort of an event by overriding the sort method. Check my posting here:

(though I have to admit that I did not sorrowly test that hack so far.)

Maybe that will help you out until vaadin 6.4 is out.


I am trying to add a very simple listener to my table header as specified in the book of Vaadin. I am using vaadin 6.4.5 in a liferay portlet. But the listener is never called…

table.addListener(new Table.HeaderClickListener() {
		    public void headerClick(HeaderClickEvent event) {
		        System.out.println("Column header clicked");		        
// Disable the default sorting behavior

I am also unable to add footer to my table like this…

		table.setColumnFooter("Name", "Average");
		table.setColumnFooter("Died At Age", String.valueOf(avgAge));

Both these code snippets were taken from the book of vaadin but they just don’t work in my portlet application. please help