1

My problem is that I am trying to make dynamic tabs with tabPanel, so I want to read some information about that tabs from my bean. And that is why I am using c:foreach. So here is that piece of code:

<a4j:outputPanel id="output">
    <rich:tabPanel width="40%" headerAlignment="right" switchType="client" binding="#{searchRequest.tabPanel}">
        <rich:tab header="#{lang.tab_basic}" id="tabBasic" name="tabBasic">
        ............Content of the first non-dynamic tab..............          
        </rich:tab>

        <c:forEach items="#{searchSession.tabs}" var="tab">
            <rich:tab name="#{tab.name}" >
                <f:facet name="label">
                    <h:panelGrid columns="2">
                        <h:outputText value="#{tab.name}" />
                        <h:graphicImage value="images/icons/delete.gif" 
                            style="width:12px; height:12px;" 
                            onclick="myFunc('#{tab.name}'); Event.stop(event);"/>
                    </h:panelGrid>
                </f:facet>
                <h:outputText value="#{tab.html}" escape="false"/>
            </rich:tab>
        </c:forEach>

    </rich:tabPanel>
</a4j:outputPanel>

Everything seems clear to me, but as usual, there is something that I don't see, so I would be very thankful if someone could tell me what is that.

tuoLarips
  • 170
  • 1
  • 10
  • what is the problem? you don't see the tabs? or what? – Daniel Jan 16 '12 at 06:22
  • the problem is that i see only one tab with empty label and empty body. so i tried to put c:foreach outside the tabpanel and to output what i get, and for the list of a few items i get only one pass through the loop, and i get empty value. – tuoLarips Jan 16 '12 at 09:54
  • Try to remove the binding="#{searchRequest.tabPanel}" , otherwise I dunno , sorry , and double check that items="#{searchSession.tabs}" holds some data, – Daniel Jan 16 '12 at 09:59
  • I checked that tabs field holds some data, I even output it on server console.. And removing binding doesn't work, but thank you anyway :) – tuoLarips Jan 16 '12 at 10:13
  • ok , last attempt , try to go over this : http://relation.to/11633.lace found some example of what your looking for in there... – Daniel Jan 16 '12 at 10:40
  • Yes, that is exactly what I was relying on. My code is based on that and still doesn't work.. – tuoLarips Jan 16 '12 at 10:51
  • http://stackoverflow.com/questions/4022193/is-there-a-way-to-create-dynamically-richtab-elements might help a bit... – Daniel Jan 16 '12 at 11:08

1 Answers1

0

I don't think there is a label facet for rich:tab (at least its not mentioned in the docs).

Niks
  • 4,802
  • 4
  • 36
  • 55
  • Ok, I see, but still I am not able to loop through the array even outside of the tabpanel. I think that is the main problem. Thanks – tuoLarips Jan 17 '12 at 13:16