7 Replies Latest reply on Apr 16, 2009 2:36 AM by Alessio Maggiori

    ContextMenu on tree strange work with 3.3.1

    Alessio Maggiori Newbie

      Hi guys,
      I've got a tree with three level with a different contextmenu for each level.
      Setting new tree's attribute rightClickSelection="true" it happen a strange work (tested with IE7, FF3).
      I'll explain:

      - contextmenu appear only al the first-level node and not at other subnode.

      - after completed selection with right click (execution of nodeSelectListener) contextmenu hide.

      - At right click all subnode show browser contextmenu but with a difference:
      IE7 apply selection when contextmenu disappear, instead FF3 do selection immediately.

      Thanks for all the advice.


      <rich:tree rightClickSelection="true" binding="#{treeModelBean.treeReq}" requestDelay="200" eventsQueue="evTree" ignoreDupResponses="true" id="id_tree" adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client" ajaxSubmitSelection="true" >
      
       <rich:treeNodesAdaptor id="request" nodes="#{treeModelBean.requests}" var="req">
       <rich:treeNode eventsQueue="evTree" nodeSelectListener="#{treeModelBean.processRic}" reRender="pnl_container,pnl_btn" iconLeaf="/resources/img/icons/16/health-care-shield-16x16.png" icon="/resources/img/icons/16/health-care-shield-16x16.png" >
       <h:outputLabel id="reqst" style="#{req.style}" value="Richiesta: #{req.accessnumber} - #{req.data}" />
      
       <rich:contextMenu submitMode="ajax" id="menu_req" attached="true" attachTo="reqst" >
      
       <rich:menuItem rendered="#{req.canDelete}" oncomplete="Richfaces.showModalPanel('popupEditRequest');" submitMode="ajax" value="Modifica Richiesta" action="#{treeModelBean.editSavedReq}" reRender="popupEditRequest,pnl_tree,pnl_btn,pnl_container,pnl_puls" />
       <rich:menuItem rendered="#{req.canDelete}" oncomplete="Richfaces.showModalPanel('confirmPanel');" submitMode="ajax" value="Elimina Richiesta" action="#{treeModelBean.prepareDelReq}" reRender="confirmPanel"/>
       <rich:menuItem rendered="#{req.newInsert}" oncomplete="Richfaces.showModalPanel('popupEditRequest');" submitMode="ajax" value="Modifica Richiesta" action="#{treeModelBean.prepareEditReq}" reRender="popupEditRequest" />
       <rich:menuItem rendered="#{req.newInsert && req.canAddImpegnativa}" value="Aggiungi Impegnativa" action="#{treeModelBean.prepareNewImpegnativa}" submitMode="ajax" oncomplete="Richfaces.showModalPanel('popupEditImpegnativa');" reRender="popupEditImpegnativa" />
       <rich:menuItem rendered="#{req.canDelete}" value="Stampa Ticket" action="#{treeModelBean.viewTicket}" />
       </rich:contextMenu>
      
       </rich:treeNode>
      
       <rich:treeNodesAdaptor id="impegn" var="imp" nodes="#{req.impegnList}">
       <rich:treeNode nodeSelectListener="#{treeModelBean.processImp}" reRender="pnl_container" iconLeaf="/resources/img/icons/16/Medical-invoice-information-16x16.png" icon="/resources/img/icons/16/Medical-invoice-information-16x16.png" >
       <h:outputLabel id="impm" style="#{imp.style}" value="Imp: #{imp.impegnativa1} #{imp.impegnativa2}" />
      
       <rich:contextMenu submitMode="ajax" rendered="#{treeModelBean.newRequest}" attached="true" attachTo="impm" >
      
       <rich:menuItem value="Modifica Impegnativa" rendered="#{!(imp.proseguimento>0)}" oncomplete="Richfaces.showModalPanel('popupEditImpegnativa');" action="#{treeModelBean.prepareEditImpegnativa}" submitMode="ajax" reRender="popupEditImpegnativa" />
       <rich:menuItem value="Elimina Impegnativa" oncomplete="Richfaces.showModalPanel('confirmDelImp');" action="#{treeModelBean.prepareDelImp}" submitMode="ajax" reRender="confirmDelImp" />
       <rich:menuItem reRender="popupNewExam" oncomplete="checkNumImp('#{treeModelBean.needNewImp}');" submitMode="ajax" value="Aggiungi Esame" action="#{treeModelBean.prepareNewExam}" />
       </rich:contextMenu>
      
       </rich:treeNode>
      
      
       <rich:treeNodesAdaptor id="exam" var="ex" nodes="#{imp.examList}">
       <rich:treeNode nodeSelectListener="#{treeModelBean.processEx}" oncomplete="javascript:Richfaces.showModalPanel('popupNewExam');" reRender="pnl_container,doc1,popupNewExam" iconLeaf="/resources/img/icons/16/colba-16x16.png" icon="/resources/img/icons/16/colba-16x16.png" >
      
       <h:outputLabel id="exm" style="#{ex.style}" value="#{ex.id}" />
       <h:outputLabel id="exm2" style="#{ex.style}" value=" (#{ex.numRepetition})" />
       <h:outputLabel id="exm3" style="#{ex.style}" value=" (*)" />
      
       <rich:contextMenu submitMode="server" rendered="#{treeModelBean.newRequest}" attached="true" attachTo="exm" >
       <rich:menuItem rendered="#{imp.ripetuto<2}" reRender="popupNewExam" oncomplete="javascript:Richfaces.showModalPanel('popupNewExam');" submitMode="ajax" value="Modifica Esame" action="#{treeModelBean.prepareEditExam}" />
       <rich:menuItem reRender="confirmDelExam" oncomplete="javascript:Richfaces.showModalPanel('confirmDelExam');" submitMode="ajax" value="Elimina Esame" />
       </rich:contextMenu>
      
       </rich:treeNode>
      
       </rich:treeNodesAdaptor>
      
       </rich:treeNodesAdaptor>
      
       </rich:treeNodesAdaptor>
      
      </rich:tree>