This content has been marked as final.
Show 5 replies
-
1. Re: <rich:tree> with checkboxes?
ishabalov Aug 3, 2007 3:48 PM (in response to viggo.navarsete)You may have anything you need in a tree model, or use built-in selection model in tree.
-
2. Re: <rich:tree> with checkboxes?
viggo.navarsete Aug 4, 2007 6:06 AM (in response to viggo.navarsete)Thanks for your repy ishabalov:)
Do you have any examples on exactly _how_ to do that? I'm pretty new to JSF in general, and Richfaces. -
3. Re: <rich:tree> with checkboxes?
evdelst Aug 6, 2007 8:06 AM (in response to viggo.navarsete)A possible solution is this:
- keep a 'Map<Object,Boolean> selected' in the sessionbean. 'Object' is the data of the treenode.
- expose the map in the interface of the SB
- refer to the the map in the template:<rich:tree value="#{bean.tree}" var="data" > <rich:treeNode> <h:selectBooleanCheckbox value="#{mybean.selection[data]}"/>${data.name} </rich:treeNode> </rich:tree> Name("mybean") @Stateful @Scope(ScopeType.CONVERSATION) public class TestMaintenanceBean implements TestMaintenance { private Map<Object, Boolean> selection=new HashMap<Object,Boolean>(); public Map<Object, Boolean> getSelection() { return selection; } }
The Map will contain your 'data' as the key and a Boolean value 'true' for selected nodes (and false for de-selected nodes, or no entry if not selected). -
4. Re: <rich:tree> with checkboxes?
evdelst Aug 6, 2007 8:07 AM (in response to viggo.navarsete)I forgot: this is with seam, but should work with plain JSF as well
-
5. Re: <rich:tree> with checkboxes?
viggo.navarsete Aug 7, 2007 7:20 AM (in response to viggo.navarsete)Thanks evdelst for your input!
I think I will try to use the Tomahawk tree, like discussed in this thread:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=113635&postdays=0&postorder=asc&start=0