6 Replies Latest reply on Feb 10, 2009 6:18 AM by shiningliao

    tree+menuItem: Is this a bug or my bad?

    shiningliao

      Hi,
      I have created a tree with menuItem as shown in the following screenshot:
      http://lkcn.net/bbs/uploads/monthly_02_2009/post-24152-1234262949.jpg

        • 2. Re: tree+menuItem: Is this a bug or my bad?
          ilya_shaikovsky

          not sure that understand the problem? could you describe pelase?

          • 3. Re: tree+menuItem: Is this a bug or my bad?
            shiningliao

            Sorry for the above hiccup. Trying to attach the screenshot but failed.

            Anyway, the problem I found is menuItem can only attach to ONE type of treeNode. Use the example in the screenshot (click on it to see), I have Queue A and Queue B nodes, both are 'Queue' type of treeNode. menuItem only work on 'Queue B' not 'Queue A'.

            A bit of experiment shows, menuItem only work on the last treeNode. It means the siutation is dynamic depends on how you expend the tree. However, it always work on the last node of the same treeNode.

            Any one got similiar problem? I am not sure if this is a bug in the tree or my implementation problem.

            • 4. Re: tree+menuItem: Is this a bug or my bad?
              ilya_shaikovsky

              seems side effect from

              https://jira.jboss.org/jira/browse/RF-3532

              thanks! I'll update the issue with your case.

              • 5. Re: tree+menuItem: Is this a bug or my bad?
                shiningliao

                Here is the partial source code to explain the problem further...

                <rich:tree nodeSelectListener="#{objectTree.processSelection}" var="item"
                ajaxSubmitSelection="true" switchType="server" id="theTree" ajaxKeys="#{null}"
                value="#{objectTree.rootNode}" nodeFace="#{item.type}">
                 <rich:treeNode type="product" iconLeaf="/images/products.png" icon="/images/products.png"
                 id="product" onclick="focus_product();">
                 <rich:dndParam name="label" type="drag">#{item}</rich:dndParam>
                 <h:outputText value="#{item.name}" />
                 </rich:treeNode>
                 <rich:treeNode type="user" iconLeaf="/images/users.png" icon="/images/users.png"
                 id="user" onclick="focus_user();">
                 <rich:dndParam name="label" type="drag">#{item}</rich:dndParam>
                 <h:outputText value="#{item.name}" />
                 </rich:treeNode>
                 <rich:treeNode type="branches" iconLeaf="/images/branches.png" icon="/images/branches.png"
                 id="branches" onclick="hide_all();">
                 <rich:dndParam name="label" type="drag">#{item}</rich:dndParam>
                 <h:outputText value="#{item.name}" />
                 </rich:treeNode>
                :
                :
                


                So, as you can see, I have a tree with several different type of treeNode.

                Any then, I have meniItem attch to each treeNode like this:
                <rich:contextMenu event="oncontextmenu" submitMode="ajax" attachTo="product">
                 <rich:menuItem value="New Product.." action="#{objectTree.addNewNode}">
                 </rich:menuItem>
                </rich:contextMenu>
                <rich:contextMenu event="oncontextmenu" submitMode="ajax" attachTo="user">
                 <rich:menuItem value="New User.." action="#{objectTree.addNewNode}">
                 </rich:menuItem>
                </rich:contextMenu>
                :
                :
                


                I was hoping any treeNode in the tree will have a menuItem pop-up when I right-click on it. Unfortunately, it isn't. Only the last one displayed in the tree....

                • 6. Re: tree+menuItem: Is this a bug or my bad?
                  shiningliao

                   

                  "ilya_shaikovsky" wrote:
                  seems side effect from

                  https://jira.jboss.org/jira/browse/RF-3532

                  thanks! I'll update the issue with your case.


                  Thank you as well. That's quick response.