Reputation: 1829
On my wicket page I have a tree and a dynamic element that is mainly created via javascript and takes some time to paint.
My problem is that whenever I expand a tree node Wicket repaints the whole page, therefore reloading the javascript and repainting everything again. As expanding a tree node has no influence on the javascript there is no need to repaint the dynamic content, still the user has to wait several seconds until everything is rendered again.
Is there any way to stop wicket from reloading everything and just exchanging the new content? And how can I implement this within a tree?
I found the following link: http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/ but I am not sure if and how I can apply this to trees.
Update: The problem solved itself together while I worked on another ajax problem I hadn't recognized earlier. Therefore I guess it was a side effect that is gone now. Still thanks.
Upvotes: 2
Views: 1043
Reputation: 5681
A node's junction component calls AbstractTree#expand(T), which calls #updateBranch(T, AjaxRequestTarget): for NestedTree this will result in a repaint of the branch only, for TableTree this will repaint the whole table.
This should not result in a refresh of the whole page.
Put breakpoints in AjaxRequestHandler#add(Component,String) and Component#setResponsePage(Class) and see who is updating the whole page.
Upvotes: 2