3 Replies Latest reply on Sep 4, 2008 1:03 PM by rajevar

    issue with dynamic tabs

    rajevar

      Hi,

      I have this code for adding tabs dynamically and its working good.


       <c:forEach items="#{rmaJobHandlerBean.currentJob.serialList}"
       var="serial">
       <rich:tab label="#{serial.serialNumber == null ?
       'New' : serial.serialNumber }" styleClass="myTabPane"
       labelWidth="#{fadbUtil.labelWidth}" >
      


      I have a button to add new Tabs and in the action event i will add a new object to the Serial List which will get reflected as new tab in TabPanel

      My issues are

      1) i want the newly added tab to be the selected one. I tried different ways but all in vain. i dont want to make it too complicated by adding a phaseListener. Anyone has faced this issue , any suggestions/help ?

      2) if i keep on adding new tabs ( suppose i added 20 tabs dynamically ), tabs are displaying off the page. is it possible to display tabs in new row if it exceeds the page width or anything like that ?

      Appreciate any help on this.

      Thanks,
      Raj

        • 1. Re: issue with dynamic tabs
          rajevar

          I missed first line of code in my previous post . here is the updated code

          
          <rich:tabPanel switchType="client" styleClass="myTable" id="serialTab"
           binding="#{rmaJobHandlerBean.tabPanel}">
           <c:forEach items="#{rmaJobHandlerBean.currentJob.serialList}"
           var="serial">
           <rich:tab label="#{serial.serialNumber == null ?
           'New' : serial.serialNumber }" styleClass="myTabPane"
           labelWidth="#{fadbUtil.labelWidth}" >
          


          Thanks,

          • 2. Re: issue with dynamic tabs
            ilya_shaikovsky

            1) just manage selectedTab attribute binded to some property in your actions.

            2) no tabpanel doesn't provides this option. you could vote on our wiki page for the features you need.

            • 3. Re: issue with dynamic tabs
              rajevar

              Thank you !!
              you suggestion helped me resolve first issue. I will add the 2nd issue to the wiki page.

              Thanks again.