You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ephraim Rosenfeld <er...@knoa.com> on 2015/08/26 21:20:07 UTC

Updating individual branches using a TableTree

Hello Everyone:

I am looking for a way to leverage the TableTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html> component while getting the Ajax updating behavior of the NestedTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.html> component.

The following post<http://stackoverflow.com/questions/19790545/stop-wicket-from-repainting-the-whole-page-after-each-ajax-call/19806978#19806978> states that when using a TableTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html>, the TableTree#updateBranch<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html#updateBranch(T,%20org.apache.wicket.ajax.AjaxRequestTarget)> causes the entire table to be updated when expanding a node. In contrast, the NestedTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.html> component overrides the updateBranch<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.html#updateBranch(T,%20org.apache.wicket.ajax.AjaxRequestTarget)> method so that the table will appear with the sub-nodes expanded without having to refresh the entire table when expanding a node.

If I try to override the TableTree#updateBranch<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html#updateBranch(T,%20org.apache.wicket.ajax.AjaxRequestTarget)>  with the same type of Visitor functionality in the NestedTree#updateBranch<https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.java> method  to add back only the Item or RowItem component when the node is expanded, only the parent node appears with the expanded icon, but the sub-node does not appear.  This makes sense because the TableTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html> component presents sub-nodes as new rows in the table.

Is it possible to override the behavior of the TableTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html> component such that the entire table need not be updated when expanding a node? Or am I better off using the NestedTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.html> component?

Thank you in advance,

- Ephraim

Re: Updating individual branches using a TableTree

Posted by Sven Meier <sv...@meiers.net>.
Hi,

NestedTree utilizes its hierarchical markup to update the expanded 
branch only. This is not possible with a tabular markup.

Either you
- use NestedTree if you don't need columns and get partial updates for free
- use TableTree because of needed columns and live with complete updates 
(similar to changes of sorting order in a DataTable)
- or invent a solution that replicates the magic of the old (deprecated) 
tree implementation (it was able to update a subset or rows with a lot 
of specialized rendering code)

Have fun
Sven


On 26.08.2015 21:20, Ephraim Rosenfeld wrote:
> Hello Everyone:
>
> I am looking for a way to leverage the TableTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html> component while getting the Ajax updating behavior of the NestedTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.html> component.
>
> The following post<http://stackoverflow.com/questions/19790545/stop-wicket-from-repainting-the-whole-page-after-each-ajax-call/19806978#19806978> states that when using a TableTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html>, the TableTree#updateBranch<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html#updateBranch(T,%20org.apache.wicket.ajax.AjaxRequestTarget)> causes the entire table to be updated when expanding a node. In contrast, the NestedTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.html> component overrides the updateBranch<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.html#updateBranch(T,%20org.apache.wicket.ajax.AjaxRequestTarget)> method so that the table will appear with the sub-nodes expanded without having to refresh the entire table when expanding a node.
>
> If I try to override the TableTree#updateBranch<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html#updateBranch(T,%20org.apache.wicket.ajax.AjaxRequestTarget)>  with the same type of Visitor functionality in the NestedTree#updateBranch<https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.java> method  to add back only the Item or RowItem component when the node is expanded, only the parent node appears with the expanded icon, but the sub-node does not appear.  This makes sense because the TableTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html> component presents sub-nodes as new rows in the table.
>
> Is it possible to override the behavior of the TableTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.html> component such that the entire table need not be updated when expanding a node? Or am I better off using the NestedTree<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.html> component?
>
> Thank you in advance,
>
> - Ephraim
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org