You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Tran Danh Thang <td...@cmc.com.vn> on 2004/11/17 14:53:43 UTC
Tree question
Does anyone have example about using treeSelectionListener tag in JSF?
Please send it to me. Thanks a lot
Re: Tree question
Posted by Nicolas Arni-Bloch <Ni...@cui.unige.ch>.
Hi,
here is a small exemple of a TreeSelectionListener how get from the
event the userObject of the node how was selectionned.
He will work if you have build your tree with DefaultMutableTreeNode.
Hope it will help.
public class MyTreeSelectionListener implements
net.sourceforge.myfaces.custom.tree.event.TreeSelectionListener{
public void
valueChanged(net.sourceforge.myfaces.custom.tree.event.TreeSelectionEven
t event) {
Object o =
((net.sourceforge.myfaces.custom.tree.DefaultMutableTreeNode)event.getNe
wSelectionPath().getLastPathComponent()).getUserObject();
}
}
Le 17 nov. 04, à 14:53, Tran Danh Thang a écrit :
> Does anyone have example about using treeSelectionListener tag in JSF?
> Please send it to me. Thanks a lot
>
>
--
Nicolas Arni-Bloch
Groupe MATIS-Bd, Centre Universitaire d'Informatique
24 rue General-Dufour
CH-1205 Genève
eMail : nicolas.arni-bloch@cui.unige.ch
phone : +41 22 379 76 80
fax : +41 22 379 77 80