You might also try something like the jenia components. I use their multipleSelector component with a datatable. However, I imagine it could work with a tree.

Philippe Lamote wrote:
Hi,

I'm sory for this question, but there's not too much doc about this on site, so... here we go:

I want to make a tree2 with checkboxes that I only collect once together, and I could use some advice:

The examples I've seen, have the commandlink at every node, by consequence fire off the second one gets clicked.

What I want, is:
- a CLIENT side tree2 (for speed)
- with checkboxes on every leaf element
- multiple leafs can be checked simultaneously ("simultaneously" meaning before a new request fires off)
- under the tree a cmd button to ONLY THEN fire off an action.

The action should then perform an opeation on all the checked leafs.

I guess thsi is possible, but how to do this best?
If possible, I'd like a solution without javascript to collect the checked nodes, yet if no other way exits, that's fine too. With js I thought of smth like: (if it works, "addToRequest(#{node.identifier});" ... should add the node ID to the request. So all checked nodes would be sent with the request wen the cmd button under the tree gets clicked.)

<t:tree2 id="clientTree" value="#{calmgmtbean.treeModel}" var="node" varNodeToggler="t">
    <f:facet name="setsTree">
        <h:panelGroup>
<h:selectBooleanCheckbox onclick="addToRequest(#{node.identifier});" /> <t:graphicImage value="..pics/calMgmt/document.png" border="0"/> <h:outputText value="#{node.description}" styleClass="#{t.nodeSelected ? 'treeSetSelected':'treeSetUnselected'}"/>
        </h:panelGroup>
    </f:facet>
</t:tree2> If possible, I would like to get rid of "addToRequest(#{node.identifier});", of even better of the entire "h:selectBooleanCheckbox" and use checkedNode (smth Matthias Wessendorf provided us with for convenience - thank you Matthias! :-)

Yet in that case, how to collect all the ckecked nodes at the server side? Is it necessary to walk over all the nodes and perform a isChecked check? (if so, does someone here has some tested code for this? Would be a ice addition to http://wiki.apache.org/myfaces/Tree2 as well. I think this would also be a fine candidate for a build-in method, to ship with the ckeckNode tree. As with a checkednode tree, you have the great option to batch process all checked nodes at once, serverside, compared to all the servertrips per checked node you'd have without a checkednode tree. (this is what I love most about it, it's a great idea, yet now I guess every dev has to program the same method over and over again for tree-traversal)

Thanks in advance,
Phil




--No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 5/22/2006




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 5/22/2006

Reply via email to