-
1. Re: RF4 PanelMenuItem (unselectable)
healeyb Jul 21, 2012 4:15 AM (in response to guarf)What itemMode and groupMode are you using? The closest I can get to reproducing this is using "server" for both
attributes (though still not doing what you describe) but it works ok with client and ajax.
I had a similar problem with rich:tabPanel which was cured by using rich:tab immediate="true", you could try
any mixture of immediate="true" on rich:panelMenu, rich:panelMenuGroup, rich:panelMenuItem.
Regards,
Brendan.
p.s. it takes a lot of the guess work out of the equation if you post the code.
-
2. Re: RF4 PanelMenuItem (unselectable)
guarf Jul 24, 2012 12:59 AM (in response to healeyb)Thanks Brendan, I'll give more details,
with an empty field, I click to save it in the menu
http://img35.imageshack.us/img35/585/84282226.jpg
is selected if the site had a warning message
http://img835.imageshack.us/img835/6338/82388866.jpg
I do a click to deselect the item and click again to
-
3. Re: RF4 PanelMenuItem (unselectable)
guarf Jul 24, 2012 1:06 AM (in response to guarf)The code attached
---------------------------
----------- MENU ----------
---------------------------
private void createPanelMenu() {
try {
FacesContext context = FacesContext.getCurrentInstance();
Application app = FacesContext.getCurrentInstance().getApplication();
panelMenu = (UIPanelMenu) app.createComponent(context, UIPanelMenu.COMPONENT_TYPE, "org.richfaces.PanelMenuRenderer");
panelMenu.setId("panelMenuNavigator");// + String.valueOf(System.currentTimeMillis()));
panelMenu.setDisabled(false);
panelMenu.setExpandSingle(true);
panelMenu.setItemClass("menuItemClass");
panelMenu.setTopGroupCollapsedRightIcon("triangleDown");
panelMenu.setTopGroupExpandedRightIcon("triangleUp");
} catch (Exception e) {
Logger.getLogger(ComponentNavigator.class.getName()).log(Level.SEVERE, null, e);
}
}
----------------------------
----------- GROUP ----------
----------------------------
private UIPanelMenuGroup createGroup(String strId, String strLabel, List lstComponents, String strAction) {
try {
FacesContext context = FacesContext.getCurrentInstance();
Application app = FacesContext.getCurrentInstance().getApplication();
ExpressionFactory expFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
ELContext elcontext = FacesContext.getCurrentInstance().getELContext();
UIPanelMenuGroup panelMenuGroup = (UIPanelMenuGroup) app.createComponent(context, UIPanelMenuGroup.COMPONENT_TYPE, "org.richfaces.PanelMenuGroupRenderer");
panelMenuGroup.setId(strId);
panelMenuGroup.setLabel(strLabel);
panelMenuGroup.setExpanded(isMenuItemFromGroup(lstComponents));
panelMenuGroup.setRender("formBase");
panelMenuGroup.setImmediate(true);
panelMenuGroup.setExpandEvent("click");
panelMenuGroup.setMode(PanelMenuMode.ajax);
MethodExpression methodExpression = expFactory.createMethodExpression(elcontext, "#{componentNavigator." + strAction + "}", null, new Class[0]);
panelMenuGroup.setActionExpression(methodExpression);
panelMenuGroup.setStyleClass("leftAlign");
panelMenuGroup.setRendered(renderedGroup(strId));
return loadItems(lstComponents, panelMenuGroup);
} catch (Exception e) {
Logger.getLogger(ComponentNavigator.class.getName()).log(Level.SEVERE, null, e);
return null;
}
}
---------------------------
----------- ITEMS ----------
---------------------------
while (it.hasNext()) {
ComponentDescriptor component = (ComponentDescriptor) it.next();
strLabel = getMessageResourceString(context.getApplication().getMessageBundle(), component.getId(), null, locale);
menuItem = (UIPanelMenuItem) app.createComponent(context, UIPanelMenuItem.COMPONENT_TYPE, "org.richfaces.PanelMenuItemRenderer");
menuItem.setId(component.getId());
menuItem.setLabel(strLabel);
menuItem.setLeftIcon(component.getIconImage());
menuItem.setExecute("@form");
menuItem.setRender("formBase");
menuItem.setStyleClass("leftAlign");
menuItem.setImmediate(component.getImmediate());
menuItem.setUnselectable(true);
if (!renderedMenuItem(component)) {
menuItem.setStyle("display:none");
}
menuItem.setMode(PanelMenuMode.ajax);
if (component.getId().equalsIgnoreCase(this.lastMenuItem)) {
panelMenu.setActiveItem(component.getId());
panelMenuGroup.setExpanded(true);
}
MethodExpression methodExpression = expFactory.createMethodExpression(elcontext, "#{" + component.getAction() + "}", null, new Class[0]);
menuItem.setActionExpression(methodExpression);
panelMenuGroup.getChildren().add(menuItem);
}
return panelMenuGroup;
-
4. Re: RF4 PanelMenuItem (unselectable)
guarf Jul 25, 2012 6:15 PM (in response to guarf)any idea ? is the only thing I need to finish the job
-
5. Re: RF4 PanelMenuItem (unselectable)
guarf Aug 3, 2012 7:25 PM (in response to guarf)no way to tell the menuitem to deselect? using javascript?