1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <ui:composition>
<h:form>
<rich:tree id="tree" switchType="client" style="position:absolute; width:300px; border:solid black 1px;" value="#{SimpleTreeDndBean.dataC}" var="item"
dragIndicator="indicator2" treeNodeVar="treeNode" nodeFace="#{item.type!=0 ? 'item' : 'node'}">
<rich:treeNode type="item" dragType="item" dragValue="#{item}">
<h:outputText value="#{item.nom}" />
<rich:dndParam name="label" type="drag" value="item #{item.nom}">#{item.nom}</rich:dndParam>
</rich:treeNode>
</rich:tree>
<a4j:outputPanel layout="block">
<rich:dropSupport acceptedTypes="item" dropListener="#{SimpleTreeDndBean.dropListener}" oncomplete="if(item.type!=1){Richfaces.showModalPanel('pnlParamRex');}" reRender="treeC" />
<rich:tree id="treeC" switchType="client" style="position:absolute; width:300px; height:300px; left:500px; border:solid black 1px;" value="#{SimpleTreeDndBean.treeC}" var="item" dragIndicator=":treeCDragIndicator" dropListener="#{SimpleTreeDndBean.dropListener}" nodeFace="item">
<rich:treeNode type="item" acceptedTypes="item" dragType="item" dragValue="#{item}">
<h:outputText value="#{item.nom} (#{item.comptage})" />
<rich:dndParam name="label" type="drag" value="item #{item.nom}">#{item.nom}</rich:dndParam>
</rich:treeNode>
</rich:tree>
</a4j:outputPanel>
<a style="position:absolute; left:900px;" onclick="Richfaces.showModalPanel('pnlParamRex');" href="#">Show ModalPanel</a>
<a4j:form>
<rich:modalPanel id="pnlParamRex">
<f:facet name="header">
<h:outputText value="This is a panel header" />
</f:facet>
<p>The <rich:modalPanel> accepts different types of information:
from simple text to iterative components such as <rich:dataTable>, etc.
</p>
<a onclick="Richfaces.hideModalPanel('pnlParamRex');" href="#">Hide</a>
</rich:modalPanel>
</a4j:form>
</h:form>
</ui:composition> |
Partager