3 Replies Latest reply on May 5, 2008 1:00 PM by Mike K

    rich:tabPanel - do all tabs get

    Mike K Newbie

      Hi I have a problem using rich:tabPanel with multiple tabs, it seems to me, that all tabs get evaluated at once (multiple id errors, all properties get read...etc.).

      My page looks like this:

       <rich:tabPanel id="retailtab" switchType="server">
       <!-- TabElement: VehicleMain -->
       <rich:tab id="vehiclemain" name="VehicleMain" disabled="false" rendered="true">
       <f:facet name="label">
       <h:panelGroup>
       <h:outputText value="#{config.getText('RD_retailMain_vehiclemain_label')}"/>
       </h:panelGroup>
       </f:facet>
       <ui:include src="/pages/retail/retailTab/vehicleMain.xhtml" />
       </rich:tab>
       <!-- TabElement: FinanceMain -->
       <rich:tab id="financemain" name="FinanceMain" disabled="false" rendered="true">
       <f:facet name="label">
       <h:panelGroup>
       <h:outputText value="#{config.getText('RD_retailMain_financemain_label')}"/>
       </h:panelGroup>
       </f:facet>
       <ui:include src="/pages/retail/retailTab/financeMain.xhtml" />
       </rich:tab>
      
      ......plenty of tabs here....
      
      </rich:tabPanel>
      


      Changing the switchType="ajax", didn't resolve this issue...
      Is there any solution, so that only the selected tab will get inserted in the jsf-tree and not all tabs at once?
      THX in advance,
      Mike


        • 1. Re: rich:tabPanel - do all tabs get get evaluated at once
          Mike K Newbie

          Could someone please help me?
          Are there any best practices concerning tabs?

          Thanks a bunch,

          Mike

          • 2. Re: rich:tabPanel - do all tabs get
            Kerdudou Ronan Apprentice

            multiple solutions...

            for the duplicate component id you should make a subview in each tab...
            i think you got this issue because you import the same file multiple time, so this is not a component issue, just that you should know that when you include a file you have to put it in a subview, or begin your included file with subview.

            for the fact that all the getter are called... in JSF i've never found a total solution, personnally i use <c:if test="${...}" each time i want to put a condition over an include.

            so conclusion :

            <rich:tabPanel switchType="ajax" selectedTab="...">
             <rich:tab label="..." >
             <c:if test='${selectedTab=="..."}'>
             <f:subview>
             <jsp:include page="..."/>
             </f:subview>
             </c:if>
             </rich:tab>
            </rich:tabPanel>


            • 3. Re: rich:tabPanel - do all tabs get
              Mike K Newbie

              Hi RonanKER,

              thanks a lot, using facelets the following did the trick:

               <c:if test="#{simpleTreeBean.selectedTab=='first'}">
               <ui:include src="/pages/first.xhtml" />
              </c:if>
              


              THX+CU Mike