Drag-And-Drop and rich:tree
pschuett Jan 17, 2011 4:25 AMHallo,
I migrate from Richfaces 3.3.x to Richfaces 4.x and I have problems to implement Drag-And-Drop for rich:tree.
I uses 4.0 20101226
I try to variants:
<rich:tree style="width:300px"
toggleType="client"
value="#{rolesBean.groupUserTree.rootNode.treeNode}" var="item" id="groupUserTree"
nodeFace="#{treeNode.parent.parent == null ? 'node' : 'leaf'}">
<rich:treeNode type="node" dragType="groupUser">
<rich:dragSource type="drag" dragValue="#{item.externalId}"/>
<h:outputText value="#{item}"/>
</rich:treeNode>
<rich:treeNode type="leaf" dragType="groupUser">
<rich:dragSource type="drag" dragValue="#{item.externalId}"/>
<h:outputText value="#{item}"/>
</rich:treeNode>
</rich:tree>
or with a4j:outputPanel
<rich:tree style="width:300px"
toggleType="client"
value="#{rolesBean.groupUserTree.rootNode.treeNode}" var="item" id="groupUserTree"
nodeFace="#{treeNode.parent.parent == null ? 'node' : 'leaf'}">
<rich:treeNode type="node" dragType="groupUser">
<a4j:outputPanel>
<rich:dragSource type="drag" dragValue="#{item.externalId}"/>
<h:outputText value="#{item}"/>
</a4j:outputPanel>
</rich:treeNode>
<rich:treeNode type="leaf" dragType="groupUser">
<a4j:outputPanel>
<rich:dragSource type="drag" dragValue="#{item.externalId}"/>
<h:outputText value="#{item}"/>
</a4j:outputPanel>
</rich:treeNode>
</rich:tree>
but I only can mark the text of the node with my mouse. Drag-And-Drop does not work.
"item" is of type javax.swing.TreeNode
I cannot find an example for Drag-And-Drop with rich:tree for Richfaces 4.
Perhaps someone can give me an example.
Thanks for help.
Ciao
Peter Schütt