0 Replies Latest reply on Nov 7, 2012 7:00 AM by Peter Fry

    rich:contentMenu example for a rich:treeModelRecursiveAdaptor (Richfaces 4.2.3.Final)

    Peter Fry Newbie

      Is there any chance that an example could be added for using rich:contentMenu with a rich:treeModelRecursiveAdaptor?

       

      I am migrating a 3.x rich faces application to 4.2.3.Final (or 4.3.x) and can't seem to get the contextMenu to behave.

       

      I have created a facelet using our standard templates embedding the simple tree content menu example from the show case and it works fine.

       

      I have also create a facelet using OUR standard templates embedding the tree model recursive adaptor example from the show case and it works fine.

       

      The problem occurs when I try to add the context menu to the recursive adaptor example. My naive attempt tried the following:

       

      <rich:tree id="contentTree" toggleType="ajax" var="item">

        <rich:treeModelRecursiveAdaptor roots="#{fileSystemBean.sourceRoots}" nodes="#{item.directories}">

          <rich:treeNode>#{item.shortPath} 

            <rich:contextMenu target="contentTree" mode="ajax">

              <rich:menuItem label="View" render="popupContent" oncomplete="#{rich:component('popup')}.show()" mode="ajax" icon="/images/icons/open.gif" />

            </rich:contextMenu>               

          </rich:treeNode>

          <rich:treeModelAdaptor nodes="#{item.files}">

            <rich:treeNode>#{item}</rich:treeNode>

          </rich:treeModelAdaptor>

        </rich:treeModelRecursiveAdaptor>

      </rich:tree>

       

      The menu appears in odd locations not next to the correct tree node.

       

      Thanks,

       

      Peter.