Hi Volker:
        It does not matter you have checked the box or not, it still
picked up the entire leafs that was being save from the database.  My
purpose is able to unchecked the one that I would like to remove it from
the existing leafs? Is there a way to do this?  Thanks again.


-----Original Message-----
From: Wong, Emmanuel (Sam) 
Sent: Wednesday, December 20, 2006 9:41 AM
To: 'MyFaces Discussion'
Subject: RE: Display tobago selectable tree

Hi Volker:
        I put it in action command or action method and it did pick up
the unchecked leafs.  Thank you very much.

-----Original Message-----
From: Volker Weber [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 20, 2006 8:25 AM
To: MyFaces Discussion
Subject: Re: Display tobago selectable tree

the getter of the TreeState is imho the wrong place to capture the
selection.

this should be done in the action method werd the result is stored.

the way you do this is ok, but you will get the selection before
rendering, not the one after submitting the page.

2006/12/20, Wong, Emmanuel (Sam) <[EMAIL PROTECTED]>:
> Now, it display the checkbox on the tree that was being selected, but
> when I unchecked one of the leafs or event try to resaving it.  The
> treestate never get never pick up the leafs that was being checked.
Am
> I doing something wrong?  This is how I tried to capture? Thanks.
>
>         /**
>          * @return the _selectedCategories
>          */
>         public TreeState getSelectedCategories() {
>                 Set<DefaultMutableTreeNode> selection =
> _selectedCategories
>                                 .getSelection();
>                 boolean empty = selection.isEmpty();
>                 if (!empty) {
>
>                         _categoriesSelection.addAll(selection);
>
>                 }
>                 return _selectedCategories;
>         }
>
>
> -----Original Message-----
> From: Volker Weber [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 20, 2006 7:52 AM
> To: MyFaces Discussion
> Subject: Re: Display tobago selectable tree
>
> Hi,
>
> just add all nodes which should displayed as selected to the selected
> set in the treeState:
>
> selectedTrees.getSelection().add(node);
>
> Regards,
>
>   Volker
>
>
> 2006/12/8, Wong, Emmanuel (Sam) <[EMAIL PROTECTED]>:
> > Hi:
> >         Is there a way you could able to display back what you have
> > saved in the database by indicate a checkmark on the Tobago tree?  I
> > have set the selectable="multiLeafOnly".  When user selected the
leafs
> > that would like to save it in the database, then user retrieve back
> the
> > selected leafs and display with a check mark as indicated the leafs
> was
> > what he saved last time. Later user could de-selected the check box
> for
> > removing the existing leaf?  Htanks.
> >
> >
> > <tc:tree value="#{Controller.Tree}"
> >                 state="#{Controller.selectedTrees}"
> >                 id="Tree" idReference="userObject.id"
> >                 nameReference="userObject.name" showIcons="true"
> >                                                 showJunctions="true"
> > showRootJunction="true" showRoot="true"
> >
> > selectable="multiLeafOnly"
> >                                                 mutable="false">
> >                                         </tc:tree>
> >
> >
> >
>

Reply via email to