1 Reply Latest reply on Mar 7, 2008 6:51 AM by mars1412

    tabpanel selection without backing bean

    mars1412 Apprentice

      is it possible to pre-select a specific tab without the need of a backing bean?

      I want to use switchtype serverside and I also need to select a specific tab when the page is rendered.

      I'd like to use an optional URL parameter for that: so if the URL parameter 'selectedTab' exists and is not empty, I want to use it for the selectedTab attribute, otherwise the selected Tab attribute should be ignored at all.
      How would I do that?
      Is this possible at all?


        • 1. Re: tabpanel selection without backing bean
          mars1412 Apprentice

          I didn't figure out how to do that without a backing bean.

          so my workaround is this helper bean:

          @Name("richTabPanelHelper")
          @Scope(ScopeType.PAGE)
          public class RichTabPanelHelper implements Serializable {
          
           /** The Constant serialVersionUID. */
           private static final long serialVersionUID = 1L;
          
           private String selectedTab;
          
           public String getSelectedTab() {
           return selectedTab;
           }
          
           public void setSelectedTab(String selectedTab) {
           this.selectedTab = selectedTab;
           }
          }


          and in pages.xml I set the initial value:
          <param name="selectedTab" value="#{richTabPanelHelper.selectedTab}" />


          where selectedTab is the URL parameter