Its been a while since I worked on tree2 but I'm planning to get back
to it soon now that the maven stuff is mostly finished.
You said all of the nodes unselected but only one node can be selected
at a time. Did you mean collapsed instead? If you really did mean
unselected, unfortunately the selected status is only easily
accessible through the action event (which knows to apply itself to
the correct node.)
A while back we introduced TreeState and TreeModel interfaces.
Unfortunately that only helps you with expand/collapse. I need to get
back to MYFACES-911 which will add a lot of new flexability to tree2.
Unfortunately the patch is now broken because of the maven reorg so I
need to rework it.
Sean
On 1/27/06, Yixing Ma <[EMAIL PROTECTED]> wrote:
>
>
> Hi, the great myfaces users and devs,
>
> I really need some help regarding the tree2.
>
> I know I can use t.setNodeSelected() to select the tree node. And rendering
> the tree node based on the selection.
>
> But how to deselect the tree node?
>
> How to refresh the tree to make all the nodes unselected?
>
> I cannot do something like below, coz the deselection event is not triggered
> by clicking on the tree. Anyone can help me?
>
> public void processAction(ActionEvent event) throws
> AbortProcessingException {
> UIComponent component = (UIComponent) event.getSource();
> while (!(component != null && component instanceof
> HtmlTree)) {
> component = component.getParent();
> }
> if (component != null) {
> HtmlTree tree = (HtmlTree) component;
> TestNode node = (TestNode) tree.getNode();
> ...
> }
> ...
> }
>
>