Wicket – refreshing ListView triggered automatically after some time

WebMarkupContainer.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5))); 

adding this behaviour directly to list view might not work. So the trick is to add list view in the WebMarkupContainer and apply ajax self updating time behaviour to that in a loop with the duration mentioned.

 

listContainer = new WebMarkupContainer(“listContainer”);
listContainer.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(20)));

rowOrderListView = new OrderListView(“orderRow”, orderDataProvider);

listContainer.setOutputMarkupId(true);
listContainer.setOutputMarkupPlaceholderTag(true);
listContainer.add(rowOrderListView);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s