PanelMenu target not working
eldariel Dec 19, 2008 1:26 PMHi there,
we want to start using RichFaces in our web applications. I'm currently building an example application for my department using most of the needed components and creating our own styleguide. Right now I'm desperately stuck and need some help. I'm sorry for asking but I've been stuck for a while with that topic now.
I am trying to build a panelMenu to get the main navigation done. Everything works well aside the target attribute. I just can't get the damn menu to use another frame to execute the action. For CommandLinks I got it to work with setting the target attribute of the form via javascript before executing the action (even if I kind of hate that workaround). The same approach doesn't work for the panelMenu since it doesn't need a form.
Am I doing something wrong here or is it a bug? If so is there a workaround?
a simplified snippet of my backing bean:
... private HtmlPanelMenu _navigationPanelMenu = null; ... FacesContext facesContext = FacesContext.getCurrentInstance(); Application application = facesContext.getApplication(); String target = "content"; _navigationPanelMenu = new HtmlPanelMenu(); _navigationPanelMenu.setLabel("Portal"); Class[] params = {}; MethodExpression actionExpression = application.getExpressionFactory() .createMethodExpression(facesContext.getELContext(), "gotoBlubb", String.class, params); HtmlPanelMenuGroup group; HtmlPanelMenuItem item; group = new HtmlPanelMenuGroup(); group.setLabel("DefDokuTool"); group.setActionExpression(actionExpression); group.setTarget(target); item = new HtmlPanelMenuItem(); item.setLabel("Sparten"); item.setActionExpression(actionExpression); item.setTarget(target); group.getChildren().add(item); _navigationPanelMenu.getChildren().add(group); ...
that's how my tag looks like:
<rich:panelMenu id="navigationPanelMenu" style="width:140px" mode="ajax" binding="#{userBean.navigationPanelMenu.navigationPanelMenu}" value="item" selectedChild="#{userBean.navigationPanelMenu.selectedChild}" iconExpandedGroup="disc" iconCollapsedGroup="disc" iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right" iconCollapsedTopGroup="chevronDown"> </rich:panelMenu>
I'm using the sun JSF implementation 1.2.07, richfaces 3.2.2.sr1, jstl 1.2
Actually I'd prefer to use css fixed positioning instead of frames. Is there maybe another way how to get a behaviour like frames done with css fixed positioning while still being able to use the jsf navigation rules?