7 Replies Latest reply on Mar 22, 2011 4:31 AM by ilya_shaikovsky

    Suggestion needed

    ravi.kuchika

      Hi,

       

           Am using Richfaces 4.0 and JSF 2.0.  I got a requirement where in its explained below.

       

      Requirement: I have a header, body,footer. In my header I have a menu, and on click of that menu I should show a page related to that menuitem without refreshing the complete page.

       

      Can any one of you suggest a solution..

       

       

      Thanks

      Ravi Kuchika

        • 1. Suggestion needed
          ilya_shaikovsky

          use

          <a:outputPanel layout="block" id="body">

          <ui:include src=#{controller.currentPage}/>

          </a:outputPanel>

           

          change include then as needed in action and render the outputPanel with new include.

          • 2. Suggestion needed
            nbelaevski

            Hi,

             

            RichFaces 4 has drop down menu, use it in ajax mode.

            • 3. Suggestion needed
              ravi.kuchika

              Hi Ilya Shaikovsky,

               

               

                 If I keep on including the pages will it not effect the performance of the application. And more over my beans should be in keepalive state and I manually clear those beans from the map which I am not interested in it.

               

              Thanks

              Ravi Kuchika

              • 4. Suggestion needed
                ravi.kuchika

                Hi Nick,

                 

                    I tried with Dropdownmenu using binding. Its not working and giving a javascript error "Richfaces not found". And my menu is not showing the menuitems.

                 

                Please help me.

                 

                Code snippet:

                 

                UIDropDownMenu dropDownMenu = null;

                  for (int i = 0; i < 4; i++) {

                          dropDownMenu = new UIDropDownMenu();

                          dropDownMenu.setStyle("border:1px solid");

                          dropDownMenu.setMode(Mode.client);

                          dropDownMenu.setJointPoint(Positioning.topRight);

                          dropDownMenu.setDirection(Positioning.bottomRight);

                        HtmlOutputText htmlOutputText = new HtmlOutputText();

                        htmlOutputText.setValue("File"+i);

                        dropDownMenu.getFacets().put("label", htmlOutputText);

                        UIMenuItem uiMenuItem = null;

                    

                 

                           for (int j = 0; j < 4; j++) {

                              uiMenuItem = new UIMenuItem();

                              uiMenuItem.setLabel("menu"+j);

                   

                 

                 

                 

                               dropDownMenu.getChildren().add(uiMenuItem);   }

                 

                 

                 

                 

                     this.getUiToolbar().getChildren().add(dropDownMenu);

                  }

                Xhtml code :

                <rich:toolbar binding="#{menuNavigationBean.uiToolbar}">
                  </rich:toolbar>

                 

                Thanks

                Ravi Kuchika

                 

                 

                 

                 

                 

                 

                 

                • 5. Suggestion needed
                  ilya_shaikovsky

                       At first using Nick's suggestion you still have to render construct the body part from the menu. And really two ways there to construct it from java code (I do not think convinient/maintainable) or to use the same dynamic includes.

                   

                       As for the problem with menu construction - http://community.jboss.org/message/594045#594045

                  • 6. Suggestion needed
                    ravi.kuchika

                    Thanks Ilya Shaikovsky

                     

                    It solved the problem.But I don't think thats a nice solution. I got the same prob with tab panel also.

                    I tried the same solution by adding a tab with rendered false. In this case it didnt worked.

                     

                    What am suppose to do?

                     

                    Thanks

                    Ravi Kuchika

                    • 7. Suggestion needed
                      ilya_shaikovsky

                      actually should works. doublecheck that resources getting prerendered succesfully using firebug Net console.

                       

                      About issues in general - should be adressed to JSF guys..