SelectOneMenu inside of TieredMenu

UI Components for JSF
Post Reply
willian
Posts: 4
Joined: 03 Jun 2014, 19:54
Location: Brazil

18 Jul 2014, 18:09

Hello,

I'm trying to use a selectOneMenu inside a TieredMenu in a submenu to be exact, and whenever I click on the box lists all the menu is hidden, so I'm using a Jquery script with stopPropagation, but is not working correctly, now the selectOneMenu don't close the selectItem when I click out of the box. Is there a properly way to do this?

I used this two examples:
http://www.primefaces.org/showcase/ui/m ... Menu.xhtml
http://www.primefaces.org/showcase/ui/i ... Menu.xhtml

My code:

Code: Select all

<p:tieredMenu style="width:200px">
	    <p:submenu label="Ajax Menuitems" icon="ui-icon-refresh" >
		    <p:menuitem value="Save" actionListener="#{menuView.save}" update="messages" icon="ui-icon-disk" />
		    <p:menuitem value="Update" actionListener="#{menuView.update}" update="messages" icon="ui-icon-arrowrefresh-1-w" />
    	</p:submenu>
	    <p:submenu label="Non-Ajax Menuitem" icon="ui-icon-newwin">
	        <p:menuitem value="Delete" actionListener="#{menuView.delete}" update="messages" ajax="false" icon="ui-icon-close" />
	    </p:submenu>
	    <p:separator />
	    <p:submenu label="Navigations" icon="ui-icon-extlink">
	     <p:menuitem>
	    	<p:selectOneMenu id="console" value="#{selectOneMenuView.console}">
		       <f:selectItem itemLabel="Select One" itemValue="" />
		       <f:selectItem itemLabel="Xbox One" itemValue="Xbox One" />
		       <f:selectItem itemLabel="PS4" itemValue="PS4" />
		       <f:selectItem itemLabel="Wii U" itemValue="Wii U" />
	 		</p:selectOneMenu>
	     </p:menuitem>
	    </p:submenu>
    </p:tieredMenu>
And my script:

Code: Select all

<script>
	$(".ui-menu-list .ui-menu-parent").on("mousedown mouseup click", function(event) {
		event.stopPropagation();
	});

</script>
Thanks :D
Last edited by willian on 21 Jul 2014, 13:39, edited 1 time in total.
Eclipse JEE Kepler
Glassfish 4.0
PrimeFaces 5

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

19 Jul 2014, 00:09

Please show YOUR code. but minimalistic and fully working

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 42 guests