-
1. Re: Drag-n-drop and rich:tree problem: drop listener is not invoked (RF 4.3.2.Final)
yuri_ Jun 6, 2013 11:10 AM (in response to yuri_)1 of 1 people found this helpfulIn case someone runs into it there's a quick workaround:
<rich:tree id="tree" value="#{orgDialog.data}" var="item"
toggleType="ajax" nodeType="${item.type}" toggleListener="#{orgDialog.toggleListener}" >
<rich:treeNode type="LEAF" id="tree_leaf">
<rich:panel id="p1">
<h:outputText value="[#{item.typeShortname}] #{item.name}"/>
</rich:panel>
</rich:treeNode>
<rich:treeNode type="NOT-LEAF" id="tree_node" expanded="#{item.expanded}">
<rich:panel id="p2">
<rich:dragSource type="orgTreeNode" dragValue="#{item}" />
<rich:dropTarget id="dt" dropValue="#{item}" acceptedTypes="orgTreeNode" />
<a:ajax event="mousedown" listener="#{orgDialog.mouseDownListener(item.id)}" />
<a:ajax event="mouseup" listener="#{orgDialog.mouseUpListener(item.id)}" render="tree" />
<h:outputText value="[#{item.typeShortname}] #{item.name}" />
</rich:panel>
</rich:treeNode>
</rich:tree>
</rich:panel>
class OrgDialog {
public void mouseDownListener(String id)
public void mouseUpListener(String id)
...}
Id params to identify the source and target items, dragSource and dropTarget tags are still needed to render the dragging.
-
2. Re: Drag-n-drop and rich:tree problem: drop listener is not invoked (RF 4.3.2.Final)
yuri_ Aug 19, 2013 9:01 AM (in response to yuri_)Finally found the problem: my tree node impl was like this
public class OrgTreeNode extends org.richfaces.model.TreeNodeImpl { ... }
changed it to
public class OrgTreeNode implements javax.swing.tree.TreeNode.TreeNode {
//implement methods
}
after that d-n-d events and ajax-type selection work ok.