1
<apex:component controller="MenuController">
    <apex:tabPanel switchType="client">
        <apex:repeat value="{!menus}" var="menu" id="theRepeat">
             <apex:tab label="{!menu.name}" name="{!menu.id}">content for tab one</apex:tab>
        </apex:repeat>
    </apex:tabPanel>
</apex:component>

Can any one please tell me what is wrong in this program? Why is this not creating a menus tab?

2 Answers 2

3

It is not supported. The apex:repeat component cannot be used as a direct child of the following components according to the apex:repeat docs.

This component cannot be used as a direct child of the following components:

  • <apex:dataTable>
  • <apex:pageBlockTable>
  • <apex:panelBar>
  • <apex:selectCheckboxes>
  • <apex:selectList>
  • <apex:selectRadio>
  • <apex:tabPanel>
0

So you want to create your tab dynamically. I think the better way to do this is to use dynamic component. Check the SF-Docs out:

Dynamic Visualforce Components

4
  • 1
    True.. but i just wanted to know why my code is not working Commented Nov 29, 2012 at 9:13
  • The <apex:tab> component must be a child of a <apex:tabPanel>. In your case it is NOT. Commented Nov 29, 2012 at 9:15
  • True ... but apex:repeat can be child of apex:tabPanel as written in docs. Commented Nov 29, 2012 at 10:39
  • Maybe a bug-feature von salesforce Commented Nov 29, 2012 at 10:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .