Map<String,String> params = context.getExternalContext().getRequestParameterMap();
if(params.containsKey(clientId)) {
String menuid = params.get(clientId + "_menuid");
MenuItem menuitem = findMenuitem(menu.getElements(), menuid);
MenuActionEvent event = new MenuActionEvent(menu, menuitem);
if(menuitem.isImmediate())
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
else
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
menu.queueEvent(event);
}
}