6 Replies Latest reply on May 22, 2009 8:12 AM by Sod Gutierrez

    rich:panelBar rendering problem

    Juan Garcia Baldasano Newbie

      Hi,

      We are using Facelets + Richfaces and have defined a layout with 4 divs, containing one of them <ui:include src="/templates/include/menu.xhtml" />.

      Each one of the menu options calls an xhtml file that uses this layout, everytime we make a navigation, the entire page (layout) reloads again (including the menu).

      There is no problem with it until we test it with IE6, we have also tried it with firefox and chrome and we've found no problems. When we select an option from the menu and the page tries to reload the rendering isn't sometimes complete and the menu ( made with a rich:panelBar) does not render completely. When this happends the rest of the components lost their normal behaivour. If we reload the page everything goes OK until we try to do the same again.

      Thanks in advance.

        • 1. Re: rich:panelBar rendering problem
          Ilya Shaikovsky Master

          show the code. And quick question.. are you using ajax navigation? It processes fine only redirect navigation. This described many times there and in the dev guide.

          • 2. Re: rich:panelBar rendering problem
            Juan Garcia Baldasano Newbie

            Thank you for your fast reply.

            Here is the code:

            menu.xhtml

            <ui:composition>
            <f:view>
            <h:form method="post" id="ourForm">
            <h:panelGrid class="floatLeft">
            <rich:panelBar id="pBM" selectedPanel="#{ourBean.panel}" height="200" width="220">
            <rich:panelBarItem label="#{geremuaMain.UserOptions}" headerClass="titulo_menu" headerClassActive="titulo_menu_activo">
            <h:panelGrid columns="1" >
            <h:outputLabel value="Enter" styleClass="menuStyle">
            <a4j:support action="doEnter" event="onclick"/>
            </h:outputLabel>
            <h:outputLabel value="#{messages.MenuOption1}" styleClass="menuStyle_menu">
            <a4j:support action="menuOptions1" event="onclick"/>
            </h:outputLabel>
            <!-- (...More options...) -->
            </h:panelGrid>
            </rich:panelBarItem>
            </rich:panelBar>
            </h:panelGrid>
            </h:form>
            </f:view>
            </ui:composition>


            faces-config.xml

            <navigation-rule>
            
            <description>MenuNavigationRules</description>
            
            <navigation-case>
            
            <from-outcome>doEnter</from-outcome>
            
            <to-view-id>/enter.xhtml</to-view-id>
            
            </navigation-case>
            
            <navigation-case>
            
            <from-outcome>menuOptions1</from-outcome>
            
            <to-view-id>/shoppingCart.xhtml</to-view-id>
            
            <!--
            
            This is the way we have tried to avoid the problem but using it we lose the locale
            
            <redirect/>
            
            -->
            
            </navigation-case>
            
            (...)
            
            </navigation-rule>
            
            


            The point is that, if we use h:outputLinks directly or if we use redirect in the navigation rules called from a4j:support action="..." we solve panelBar problem but we realized that user selected Locale was lost. This is how we set the locale:

            FacesContext context = FacesContext.getCurrentInstance();
            context.getViewRoot().setLocale(new Locale("en"));


            Hope this helps you.

            Thanks again.

            • 3. Re: rich:panelBar rendering problem
              Ilya Shaikovsky Master

              if you want perform submits from the child Item components you should define submitMode=none for menu or concrete children.

              • 4. Re: rich:panelBar rendering problem
                Sod Gutierrez Newbie

                Hello ilya_shaikovsky, the problem is that we are not using menu, we are using a panelBar, and on each one of the panelBarItems we have an outputLabel with a4j:support calling a method on the onClick event, wich returns the string for using it with the navigation rules.

                Is when using this kind of navigation, when the new page is being rendered, after the navigation is done, is when the panelBar gets middle-white coloured like if it wasn't completely rendered.

                Thank you!

                • 5. Re: rich:panelBar rendering problem
                  Ilya Shaikovsky Master

                  sorry :( It was fool mistake :)

                  so.. you wants to navigate using support. Sure you will lost the locale with redirect. But we not supports navigation without it. The only way except redirect is to have all the content wrapped within included content(using a4j:include)... a4j:include allows to use standard navigation via ajax and without redirects inside.

                  • 6. Re: rich:panelBar rendering problem
                    Sod Gutierrez Newbie

                    As we said we are using Facelets and the menu and the body we load on each page are independent xhtml files. If i've correctly understand we can't do the navigation without redirect? Is it the only way to have everything well rendered when working with richfaces? Is there something wrong with the code we've pasted above?

                    Thanks for your help!