This content has been marked as final.
Show 3 replies
-
1. Re: Perform pages on the body index page.
ilya_shaikovsky Jun 2, 2009 6:52 AM (in response to skaka09)<rich:menu submitMode="ajax"> <rich:menuItem reRender="content" value="first"> <a4j:actionparam name="pageToGo" value="/first.xhtml" assignTo="#{bean.pageToGo}"> </rich:menuItem> <rich:menuItem reRender="content" value="second"> <a4j:actionparam name="pageToGo" value="/second.xhtml"assignTo="#{bean.pageToGo}"> </rich:menuItem> .... <a4j:outputPanel id="content"> <a4j:include viewId="#{bean.pageToGo}"> </a4j:outputPanel>
And create a bean with the String pageToGo property. After the menu item will be clicked new value will be set to the property and include will show you new page. -
2. Re: Perform pages on the body index page.
skaka09 Jun 3, 2009 2:20 AM (in response to skaka09)Hi ilya_shaikovsky.
i followed by your instruction step by step , but i didn't get the final display on the main page.
i write code here :<body> <f:view> <h:form> <tr> <rich:dropDownMenu styleClass="myClass"> <f:facet name="label"> <h:panelGroup> <h:outputText value="File"/> </h:panelGroup> </f:facet> <rich:menuItem submitMode="ajax" reRender="content" value="New"> <a4j:actionparam name="PageGoTo" value="/MenuLeft.jsp" assignTo="#{BeanPageGoTo.pageGoTo}"/> </rich:menuItem> <rich:menuItem submitMode="ajax" reRender="content" value="Open" > <a4j:actionparam name="PageGoTo" value="/chapter1.jsp" assignTo="#{BeanPageGoTo.pageGoTo}"/> </rich:menuItem> </rich:dropDownMenu> </tr> <tr> <a4j:outputPanel id="content"> <a4j:include viewId="#{BeanPageGoTo.pageGoTo}"/> </a4j:outputPanel> </tr> </h:form> </f:view> </body>
and Bean also completed here :public class BeanPageGoTo { private String PageGoTo="chapter2.jsp"; /** Creates a new instance of BeanPageGoTo */ public BeanPageGoTo() { } public void setPageGoTo(String PageGo) { this.PageGoTo = PageGo; } public String getPageGoTo() { return PageGoTo; } public String updateCurrent() { FacesContext context=FacesContext.getCurrentInstance(); setPageGoTo((String)context.getExternalContext().getRequestParameterMap().get("PageGoTo")); return null; } }
i didn't see happen when i clicks on the menu item.
i don't know why ?
please give me advice.
thank your regards -
3. Re: Perform pages on the body index page.
ilya_shaikovsky Jun 3, 2009 5:08 AM (in response to skaka09)1) do you think that such usage is valid?
<body> <f:view> <h:form> <tr>
2) after 1) correction check in the debug that property actually set.
3) if property set bot rerendering not happens check a4j:log for errors.