3 Replies Latest reply on Apr 11, 2011 3:53 AM by ilya_shaikovsky

    tab panel selectedTab attribute doesn't work

    ainanmis

      Default selected tab is first tab. I want to open second tab firstly. I set selectedTab attribute , but it didn't work.

      <rich:tabPanel id="tp"  switchType="ajax" selectedTab="doktor">

       

                                          <rich:tab  id="hasta" header="Hasta Bilgi Formu">

                                                <ui:include src="/hastaBilgi.xhtml"></ui:include>

                                                         <h:commandButton value="Kaydet ve devam et" action="#{provizyonBean.devamEt}">

                                                       </h:commandButton>

                                          </rich:tab>

       

                                       <rich:tab name ="doktor" id="doktor" header="Doktor Bilgileri" >

                                                 <ui:include src="/doktorBilgi.xhtml"></ui:include>

                                              <h:commandButton value="Geri" action=" ">

       

                                           </h:commandButton>

                                           <h:commandButton value="Kaydet ve devam et" action="#{provizyonBean.devamEt}">

                                              <rich:toggleControl targetPanel="tp" targetItem="@next" />

                                          </h:commandButton>

                                          </rich:tab>

       

      </rich:tabPanel>

        • 1. tab panel selectedTab attribute doesn't work
          iabughosh

          Hi Abdulkerim,

          selectedTab is removed in RichFaces 4, but you can use this switchToItem function of rich:tabPanel on the body onload function :

          <h:body onload="#{rich:component('mainPanel')}.switchToItem('tab2');">

          .

          .

          <rich:tabPanel id="mainPanel" switchType="ajax">

                                                  <rich:tab  name="tab1" >

                                                            <h:outputText value="Tab Content 1" />

                                                  </rich:tab>

                                                  <rich:tab name="tab2" >

                                                            <h:outputText value="Tab Content 2" />

                                                  </rich:tab>

                                                  <rich:tab  name="tab3">

                                                            <h:outputText value="Tab Content 3" />

                                                  </rich:tab>

                                        </rich:tabPanel>

           

          regards.

          • 2. tab panel selectedTab attribute doesn't work
            ainanmis

            Hi,

            Actually I am trying to change tab dynamically from bean . All tabs is firstly disabled. Each tab will be filled. After filling , user will click a button for next tab. This button will make next tab enabled and change tab to next tab.  I used activeItem attribute instead of selectedTab.

            thanks for your help.

            • 3. tab panel selectedTab attribute doesn't work
              ilya_shaikovsky

              use activeItem attribute. It's used at all the panel now. (toggle, tab, accordion, panleMenu)