0 Replies Latest reply on May 16, 2007 5:07 AM by Melanie Ntolo

    TreeNode and Drop down menu

    Melanie Ntolo Newbie

      Is it possible to define a drop down menu inside a treeNode like this:

      <a4j:outputPanel layout="block" id="treePanel" ajaxRendered="true">
      
       <rich:tree name="adminTree" style="width:300px" value="#{TPZAdminTreeBean.data}" var="item"
       nodeFace="#{item.type}"
       ajaxSubmitSelection="true"
       icon="#{item.icon}"
       iconLeaf="#{item.iconLeaf}"
       switchType="ajax"
       binding="#{TPZAdminTreeBean.tree}"
       componentState="#{TPZAdminTreeBean.dataComponentState}">
      
       <rich:treeNode value="item" ajaxSubmitSelection="true" type="SYSTEM" nodeSelectListener="#{TPZAdminTreeBean.onTreeSelection}">
       <ddm:dropDownMenu event="oncontextmenu" value="#{item.resource.name}" >
       <mc:menuItem value="Nouveau domaine" submitMode="ajax" ajaxSingle="true" icon="/view/images/goblet_gold_add24.png" onclick="openNewWindow('../new/TPZAdminNewDomain.seam')"/>
       </ddm:dropDownMenu>
       </rich:treeNode>
      
       <rich:treeNode name="adminDomainNode" value="item" ajaxSubmitSelection="true" id="adminDomainNode" type="DOMAIN" nodeSelectListener="#{TPZAdminTreeBean.onTreeSelection}">
       <ddm:dropDownMenu event="oncontextmenu" id="MenuItem1" verticalOffset="#{bean.verticalOffset}" horizontalOffset="#{bean.horizontalOffset}" popupWidth="#{bean.width}" value="#{item.resource.name}" jointPoint="#{bean.jointPoint}" direction="#{bean.direction}">
       <mc:menuItem id="menuItem11" value="Supprimer" submitMode="ajax" ajaxSingle="true" icon="/view/images/Clear16.png" action="#{TPZAdminTreeBean.deleteNode(item)}" reRender="treePanel"/>
       <mc:menuItem id="menuItem12" value="Editer" submitMode="ajax" ajaxSingle="true" icon="/view/images/Edit16.png" onclick="openEditWindow('../edit/TPZAdminEditDomain.seam')" action="#{TPZAdminTreeBean.setNodeToEdit(item)}" reRender="treePanel" immediate="true"/>
       <mc:menuItem id="menuItem13" value="Inserer un OTU" submitMode="ajax" ajaxSingle="true" onclick="openEditWindow('../new/TPZAdminNewOTU.seam')" action="#{TPZAdminTreeBean.setNewOtuParentDomain(item)}" reRender="treePanel" />
       </ddm:dropDownMenu>
       </rich:treeNode>
      
       <rich:treeNode name="adminLinkNode" ajaxSubmitSelection="true" value="item" id="adminLinkNode" type="LINK" nodeSelectListener="#{TPZAdminTreeBean.onTreeSelection}">
       <s:link value="#{item.resource.name}" target="DetailWindow" action="#{TPZAdminTreeBean.forwardToDetailPage('LINK')}" onclick="openDetailWindow('../detail/link/TPZNOCDetailLink.seam')"/>
       </rich:treeNode>
      
       <rich:treeNode name="adminOtuNode" ajaxSubmitSelection="true" value="item" id="adminOtuNode" type="OTU" nodeSelectListener="#{TPZAdminTreeBean.onTreeSelection}">
      
       <ddm:dropDownMenu event="oncontextmenu" value="#{item.resource.name}" >
       <mc:menuItem value="Supprimer" submitMode="ajax" ajaxSingle="true" icon="/view/images/Clear16.png" action="#{TPZAdminTreeBean.deleteNode(item)}" reRender="treePanel"/>
       <mc:menuItem value="Editer" submitMode="ajax" ajaxSingle="true" icon="/view/images/Edit16.png" onclick="openEditWindow('../edit/TPZAdminEditOtu.seam')" action="#{TPZAdminTreeBean.setNodeToEdit(item)}" immediate="true"/>
       <mc:menuSeparator/>
      
       <mc:menuItem value="Deplacer" submitMode="ajax" ajaxSingle="true" onclick="openEditWindow('../move/TPZDomainList.seam')" action="#{TPZAdminTreeBean.setNodeToMove(item)}" immediate="true"/>/>
       <mc:menuItem value="Copier" submitMode="ajax" ajaxSingle="true" onclick="openEditWindow('../move/TPZDomainList.seam')" action="#{TPZAdminTreeBean.setNodeToMove(item)}" immediate="true"/>/>/>
      
       </ddm:dropDownMenu>
       </rich:treeNode>
      
       <rich:treeNode name="adminServiceNode" value="item" ajaxSubmitSelection="true" id="adminSectionNode" type="SECTION" nodeSelectListener="#{TPZAdminTreeBean.onTreeSelection}" >
       <s:link value="#{item.resource.name}" target="DetailWindow" action="#{TPZAdminTreeBean.forwardToDetailPage('SECTION')}"/>
       </rich:treeNode>
       <rich:treeNode name="adminOtauNode" value="item" id="adminOtauNode" ajaxSubmitSelection="true"
       type="OTAU" nodeSelectListener="#{TPZAdminTreeBean.onTreeSelection}">
       <h:outputText value="#{item.resource.name}" />
       </rich:treeNode>
       </rich:tree>
      
      </a4j:outputPanel>


      How do I get my tree rendered again after an operation like adding/modifying/deleting a node?

      Thanks so much for your help.