[Solved] P:ContextMenu doesn't appear in overlayPanel

UI Components for JSF
Post Reply
tech4
Posts: 18
Joined: 12 Aug 2014, 00:41

06 Nov 2014, 17:00

I try to add a contextMenu in a tree to perform a custom action. This tree is implemented inside an overlaypanel. What i observed is that the contextMenu only appears in random situations like after selecting and unselecting some elements on the tree. Any Idea?

Code: Select all

<p:overlayPanel id="advancedSearchPanel" 
                                    styleClass="ui-advanced-search-overlay"
                                    for="advancedSearch" 
                                    hideEffect="fade" 
                                    my="right top" 
                                    widgetVar="advancedSearchPanelWidgetVar" 
                                    > 


  <ui:include src="/search/advancedSearch-form.xhtml"/>  
 </p:overlayPanel>
advancedSearch-form

Code: Select all

<p:panelGrid  id="panelAdvanced" styleClass="borderless">
...
   <p:row> 
      <p:column colspan="4"> 
           <p:outputLabel value="#{text['searchForm.classifiers']}" for="treeClassifier" styleClass="paddingLabelGrid"/>
           <p:contextMenu id="contextSearch" for="treeClassifier">
                            <p:menuitem value="Escolha todos" update=":searchForm:treeClassifier" actionListener="#{navBarController.displaySelectedSingle}"/>
            </p:contextMenu>
            <p:tree id="treeClassifier" value="#{navBarController.rootClassifier}" var="node" selectionMode="checkbox" selection="#            {navBarController.selectedClassifiers}" style="height: 200px;width: 540px; margin-bottom: 0px; overflow: auto" propagateSelectionDown="false" propagateSelectionUp="false">
                            <p:ajax event="select" update=":searchForm:btnSearch"/> 
                            <p:ajax event="unselect" update=":searchForm:btnSearch"/>     
                            <p:treeNode expandedIcon="ui-icon-folder-open" collapsedIcon="ui-icon-folder-collapsed">
                                <h:outputText value="#{node.description}(#{node.code})"/> 
                            </p:treeNode>  
            </p:tree>
       </p:column>   
   </p:row>
...
Last edited by tech4 on 18 Nov 2014, 02:01, edited 2 times in total.
Primefaces 5 Glassfish

tech4
Posts: 18
Joined: 12 Aug 2014, 00:41

10 Nov 2014, 17:00

In short, i want the checkbox in the tree to select nodes, located at any level, but i don't want to select automatically its childs. On the other hand, i want the contextMenu to select the node and its children. These two features i need to perform in every node of the tree. Is that possible?
Primefaces 5 Glassfish

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

11 Nov 2014, 00:08

Overlay components like overlayPanel and contextMenu should be avoided to put in containers like tables aka panelGrid. Try append to body if it is necessary.

tech4
Posts: 18
Joined: 12 Aug 2014, 00:41

18 Nov 2014, 01:59

The problem was the z-index of the contextMenu. I put a higher value for that element and now i can execute the two actions on the node.
Primefaces 5 Glassfish

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 51 guests