Hi, i have created two tree and implement drag'n drop functionality, it's all ok from view the tree childs are correctly moved from one tree to another but the problem is that ajax listener is'nt called, this is my code in jspx:
<h:body>
<h:form id="form1" prependId="false">
<h:panelGrid border="0" columns="2" style="width: 1100px; height: 459px; margin-left: 50px">
<p:panel style=" float:left; overflow-y: auto;width: 650px; height: 459px;">
<p:tree id="gerarchiaTree" widgetVar="gerarchiaTree"
value="#{mraAlbero.radiceTree}" var="treeNode"
style=" height: 459px; width: 650px; border:none;" dynamic="true"
selectionMode="single" selection="#{mraAlbero.selectedNode}"
draggable="true" droppable="true" dragdropScope="all" update="@form1">
<p:ajax event="dragdrop" listener="#{mraAlbero.onDragDrop}" />
<p:treeNode expandedIcon="ui-icon ui-icon-folder-open"
collapsedIcon="ui-icon ui-icon-folder-collapsed">
<h:outputText value="#{treeNode}"
style="font-size: 10px; margin-left: 3px" escape="false" />
</p:treeNode>
</p:tree>
</p:panel>
<h:panelGroup border="0" style="position: relative; top: 0;">
<p:scrollPanel style="width:440px; height: 459px;">
<p:accordionPanel style="width: 440px; position: relative; top: 0;" autoHeight="false">
<p:tab title="... Centri">
<p:tree id="gerarchiaTreeCrDisponibili" widgetVar="gerarchiaTreeCrDisponibili"
value="#{mraAlbero.radiceTreeCrDisponibili}" var="treeNodeCrDisponibili" rendered="true"
style=" height: 459px; width: 650px; border:none;"
dynamic="true" selectionMode="single" selection="#{mraAlbero.selectedNodeCrDisponibili}"
draggable="true" droppable="true" dragdropScope="all" update="@form1">
<p:ajax event="dragdrop" listener="#{mraAlbero.onDragDrop}" />
<p:treeNode expandedIcon="ui-icon ui-icon-folder-open" collapsedIcon="ui-icon ui-icon-folder-collapsed">
<h:outputText value="#{treeNodeCrDisponibili}"
style="font-size: 10px; margin-left: 3px" escape="false" />
</p:treeNode>
</p:tree>
</p:tab>
</p:accordionPanel>
</p:scrollPanel>
</h:panelGroup>
</h:panelGrid>
</h:form>
</h:body>
</html>
in my Managed Bean the method not called:
public void onDragDrop(TreeDragDropEvent event) {
TreeNode dragNode = event.getDragNode();
TreeNode dropNode = event.getDropNode();
int dropIndex = event.getDropIndex();
String msg = "Dragged " + dragNode.getData() + " Dropped on " + dropNode.getData() + " at " + dropIndex;
}
thanks for support!
Tree drag'n drop issue
-
- Information
-
Who is online
Users browsing this forum: No registered users and 32 guests