Hi all,
I'm trying to create a tabPanel where the tabs are inserted / removed dynamically;
I tried to achieve this through xhtml in these ways:
solution one:
<rich:tabPanel>
<ui:repeat value="#{mycomponent.tabdatalist}" var="tabdata">
<rich:tab label="#{tabdata.label}">
<ui:insert name="tabcontent"/>
</rich:tab>
</ui:repeat>
</rich:tabPanel>
solution two:
<rich:tabPanel>
<a4j:repeat value="#{mycomponent.tabdatalist}" var="tabdata">
<rich:tab label="#{tabdata.label}">
<ui:insert name="tabcontent"/>
</rich:tab>
</a4j:repeat>
</rich:tabPanel>
- solution one fails saying no selected tab present (I think there's a problem of creation / evaluation sequence.. it seems it does not fill the tabPanel at all);
- solution two fails saying that the parent of the tab is not the tabPanel but the a4j:repeat element.
I'm not creating the tabPanel programmatically because of the ui:insert tag (it seems there's no api to do this programmatically) and because I find this practice a little bit boring and confusing (but this is a problem of mine).
So, the suggestion (the best solution for me.. but if you have another one is ok):
<rich:tabPanel value="#{mycomponent.tabdatalist}" var="tabdata">
<rich:tab label="#{tabdata.label}">
<ui:insert name="tabcontent"/>
</rich:tab>
</rich:tabPanel>
As always...
Thank you,
Regards,
Raffaele Camanzo