Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.
<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>

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

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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>
share|improve this answer

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

share|improve this answer
True.. but i just wanted to know why my code is not working –  Pramod Kumar Nov 29 '12 at 9:13
The <apex:tab> component must be a child of a <apex:tabPanel>. In your case it is NOT. –  mast0r Nov 29 '12 at 9:15
True ... but apex:repeat can be child of apex:tabPanel as written in docs. –  Pramod Kumar Nov 29 '12 at 10:39
Maybe a bug-feature von salesforce –  mast0r Nov 29 '12 at 10:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.