Skip to content
Advertisement

Wicket – how to refresh single row in a table with ajax

In my wicket application I have a table where each column of a row described by one bean. One of the column contains an ajax component that can change the values in the bean and therefore the values displayed in other columns.

How can I update these columns without reloading the whole table?

Now I use the following code:

JavaScript

But for the proper work of this code I have to set outputMarkupId(true) for the root component of each column, created in IColumn#populateItem.

Is there any other way to do this?

Advertisement

Answer

Override DataTable#newRowItem() and return some custom Item implementation that has outputMarkupId = true.

JavaScript

Then in your Ajax callback method do:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement