4 Replies Latest reply on Apr 8, 2009 10:08 AM by pkqueries

    panelGrid binding with RichFaces Drop down menus

    pkqueries

      Hi,

      On my xhtml page, I have

      <t:panelGrid id="actionMenuItemsId" binding="#{home.actionMenu}" />

      And in my backing bean I have a variable called actionMenu with getters and setters. And I dynamically create RichFaces DropDownMenus as HtmlPanelGrid Children in getActionMenu method.

      The first time I load the page, the method getActionMenu() is being called and the DropDownMenu's are being created. Once I click on some link/button which reloads the whole page, the getActionMenu() is NOT being called. And the menus are not being changed.

      Please advice if something I am missing here. I very much appreciate your kind help.

      Thanks in Advance for your time and advice.
      Regards,
      Kumar

        • 1. Re: panelGrid binding with RichFaces Drop down menus
          ilya_shaikovsky

          from the beggining make sure your binding is request scoped.

          • 2. Re: panelGrid binding with RichFaces Drop down menus
            pkqueries

            Hi Ilya Shaikovsky,

            Thanks a lot for your help.

            We have home bean configured as session scoped. And this home bean is being used in everywhere throughout the application.

            In this scenario, please advice how I can make this binding request scoped?

            Also we are using this panelgrid binding elsewhere in the application and it works perfect. The only difference is that there we dont have richfaces menus as children of panelgrid. I am not sure, if this can be because of this combination? This may not be also because I kept a debug point inside getActionMenu() menu and it is not being called on click of any link on the page.

            Please advice.

            Thank you again
            Regards,
            Kumar

            • 3. Re: panelGrid binding with RichFaces Drop down menus
              ilya_shaikovsky

              just move any view properties to request scoped bean and inject to your session bean if need.

              • 4. Re: panelGrid binding with RichFaces Drop down menus
                pkqueries


                Hi Ilya Shaikovsky,

                Thanks again for you advice. If I understood correctly, you want me to create another bean which is request scoped and associate with it actionMenu

                ------

                But I have a related query that on the same xhtml page I have this

                <rich:dropDownMenu binding="#{home.recentViewMenu}"> </rich:dropDownMenu>

                which works perfectly (means that getRecentViewMenu() is being called always when user submits any request)

                And the following component calls getActionMenu() only the first time user loads the page and NOT on subsequent user form submits

                <t:panelGrid id="actionMenuItemsId" binding="#{home.actionMenu}" />


                I am just not able to understand this difference, please help.

                Regards,
                Kumar