voyent
ace:contextMenu with label and submenu won't open  XML
Forum Index -> General Help
Author Message
Maksim_A

Joined: 27/Feb/2018 02:01:24
Messages: 18
Offline


Greetings. I have a context menu, there is a submenu in it. The situation is such that when I add a label to my submenu, the menu ceases to come off (it appears, but immediately closes). If I remove the label on submenu, then everything works. What could be wrong?

Code:
<ace:contextMenu id="webDesktopPopup">
 					<c:forEach var="menuItem" items="${popupMenuBean.menuItems}">
 						<ace:menuItem value="#{menuItem.value}" actionListener="#{popupMenuBean.actionPerformed}" icon="#{menuItem.icon}"
 									  rendered="#{menuItem.childCount == 0}">
 						</ace:menuItem>
 							<ace:submenu rendered="#{menuItem.childCount > 0}" label="#{menuItem.value}">
 								<c:forEach var="subMenuItem" items="${menuItem.children}">
 									<ace:menuItem value="#{subMenuItem.value}" actionListener="#{popupMenuBean.actionPerformed}">
 									</ace:menuItem>
 								</c:forEach>
 							</ace:submenu>
 					</c:forEach>
 				</ace:contextMenu>

I use Icefaces 4.2 and JSF 2.3
artzambrano

Joined: 21/Mar/2007 00:00:00
Messages: 175
Offline


Hello Maksim_A,

I don't see anything wrong with your markup. Perhaps using JSF 2.3 could have something to do with it, as it's not fully supported yet, but I doubt it has anything to do with it.

Our showcase examples have context menu's with submenus that have labels, and they don't present this issue.

Can you please do this test? Just build the context menu without using c:forEach, maybe just put one or two submenus, and see if you can reproduce the same issue or not.

Art

Art Zambrano
ICEsoft Technologies Inc.
Maksim_A

Joined: 27/Feb/2018 02:01:24
Messages: 18
Offline


artzambrano wrote:
Hello Maksim_A,

I don't see anything wrong with your markup. Perhaps using JSF 2.3 could have something to do with it, as it's not fully supported yet, but I doubt it has anything to do with it.

Our showcase examples have context menu's with submenus that have labels, and they don't present this issue.

Can you please do this test? Just build the context menu without using c:forEach, maybe just put one or two submenus, and see if you can reproduce the same issue or not.

Art 


The same problem without a c:forEach. The problem is in the tag label. Without it everything is working fine. I'll try an earlier version of JSF, but I'm not sure that this will help.
Maksim_A

Joined: 27/Feb/2018 02:01:24
Messages: 18
Offline


artzambrano wrote:
Hello Maksim_A,

I don't see anything wrong with your markup. Perhaps using JSF 2.3 could have something to do with it, as it's not fully supported yet, but I doubt it has anything to do with it.

Our showcase examples have context menu's with submenus that have labels, and they don't present this issue.

Can you please do this test? Just build the context menu without using c:forEach, maybe just put one or two submenus, and see if you can reproduce the same issue or not.

Art 


My problem was not solved. Is it possible that this may be due to the fact that I call the context menu by clicking on the node from the ace:tree component? The button itself, which is responsible for calling the menu, looks like this:
Code:
                <h:commandLink immediate="true"
                   actionListener="#{node.userObject.showPopupMenu}" value=""
                   style="display: inline;">
                   <f:ajax execute="@all" render="@all"/>
                   <f:verbatim />
                   <h:outputText value="" style="display: inline;" />
                 </h:commandLink>

Maksim_A

Joined: 27/Feb/2018 02:01:24
Messages: 18
Offline


Ok, it works fine(well, not quite, but almost) with the component ace:menu, but how do I choose the right position and make this component as popupMenu? I tried to do it as in the example, but it did not help. The menu is displayed in the lower left corner and does not close after clicking on the component. My code:
Code:
				<ace:menu id="webDesktopPopup" position="dynamic" triggerEvent="rtclick" type="tiered">
 					<c:forEach var="menuItem" items="${popupMenuBean.menuItems}">
 						<ace:menuItem value="#{menuItem.value}" actionListener="#{popupMenuBean.actionPerformed}" icon="#{menuItem.icon}"
 									  rendered="#{menuItem.childCount == 0}">
 						</ace:menuItem>
 							<ace:submenu rendered="#{menuItem.childCount > 0}" label="#{menuItem.value}">
 								<c:forEach var="subMenuItem" items="${menuItem.children}">
 									<ace:menuItem value="#{subMenuItem.value}" actionListener="#{popupMenuBean.actionPerformed}">
 									</ace:menuItem>
 								</c:forEach>
 							</ace:submenu>
 					</c:forEach>
 				</ace:menu>

How can i imitate the work of popup menu? And how to make the menu appear where the mouse button was pressed? I tried to use this example http://icefaces-showcase.icesoft.org/showcase.jsf?grp=ace:menu&exp=As%20Popup but it did not work.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team