3 Replies Latest reply on Jun 3, 2009 5:08 AM by Ilya Shaikovsky

    Perform pages on the body index page.

    benziman kirism Newbie

      Hi all .

      i have the problem to perform pages on the body index page when i click on the each items on the left directory contain links look like as

      http://livedemo.exadel.com/richfaces-demo/richfaces/extendedDataTable.jsf?c=extendedDataTable&tab=usage

      example :

      For the Data Iteration contains many links inside it , when the user clicks on the column , column group ,column , or data definition list links perform the body of index page suitable to the content of each pages is chose.

      I hope that you can provide to me the brieft example , or bean manage the action to solve my troubles.

      everyone have good performance , please share experiment to me if it is possible.

      please try to help me.

      thank regards


        • 1. Re: Perform pages on the body index page.
          Ilya Shaikovsky Master

           

          <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.
            benziman kirism Newbie

            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 Master

              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.