Question

I'm currently writing a web application. I am using an AjaxFallbackDefaultDataTable to display domain objects. The tables include pagination and so far everything works just fine.

What I want to be able to do: In my implementation of IColumn<T> I am returning my own header component via Component getHeader(String componentId). This component depends on the page and page size which is currently used by the table (it shows a link to another page which should only care about the current slice of data). Now, I have implemented the void onPageChanged() method of the table so that it updates the columns accordingly.

Problem: I am using the Wicket AJAX debug window and it shows me that the whole table is rerendered on the server and sent to the client. However, the headers doesn't seem to update correctly so that I'm forever stuck with page 0. Using a debugger I can clearly see that Component getHeader(String componentId) is only called once, when the table is created initially.

Question: Is there any way I can solve this issue without writing my own implementation of an AJAXified data table? If not, can somebody please point me in the right direction?

Was it helpful?

Solution

HeadersToolbar creates the headers once only.

Either you implement your own toolbar recreating the headers before each render, or rewrite your header component to always render an up-to-date link.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top