You need to sign in to do that
Don't have an account?

Switch ON/OFF tabs from Tabpanel
Hello Board,
I have created tab for custom object Job__c, which is overidden by VF page.
The overrided page show Job information in <apex:Tabpanel>
The first tab in tabpanel is used to display Job detail information.
The other tabs are used to display related list for that Job.
The tabpanel is structure is like this:
<apex:page> <apex:form> <apex:tapanel> <apex:tab label="Detail"> <apex:detail/> </apex:tab> <apex:tab label="Related List 1"> <apex:relatedList subject="{!Job__c}" list="Job_Specs__r"/> </apex:tab> <apex:tab label="Related List 1"> <apex:include pageName="VF_page1"/> </apex:tab> </apex:tabpanel> </apex:form> </apex:page>
I want to switch on-off these tabs based on User requirement. Is there any way to do this?
As, these tabs are from displayed using visualforce page Tabpanel.
Thanks,
Devendra
We had a similar issue, needed to not render certain tabs for a Visualforce page (overrides Account) when a user does not have access to the tab object.
After reading this page
http://blog.deliveredinnovation.com/2011/02/05/render-visualforce-components-dynamically-based-on-object-level-security/
we used
rendered="{!$ObjectType.myCustomObject__c.accessible}"
All Answers
Hi Devendra,
I did tab navigation similarly with user input. if you give tabname it automatically selects the tab.
<apex:tabPanel switchType="client" value="{!TabInFocus}" id="testTabs">
<apex:tab label="oneTab" name="oneTab" id="tab1" >
<p>This is number one</p>
</apex:tab>
<apex:tab label="twoTab" name="twoTab" id="tab2" >
<p>This is number two</p>
</apex:tab>
<apex:tab label="threeTab" name="threeTab" id="tab3" >
<p>This is number three</p>
</apex:tab>
</apex:tabPanel>
<apex:form >
<apex:inputText value="{!tname}" id="theTextInput"/>
<apex:commandButton action="{!gotoquestions}" value="go" id="theButton"/>
</apex:form>
Thanks sreenath for reply.
But my requirement is different.
This page will be used in managed package. Thus it will be used by different subscribers. Hence a subscriber will decide which tab from tabPanel wants use.
So i am looking for a way to display tabs based on subsciber demand.
Thanks,
Devendra
hey!! You can use rendered functionality on Tabs.
try this
<apex:tab rendered="{!visible}"/>
based on User, you can make it visible in apex class.
Thanks
We had a similar issue, needed to not render certain tabs for a Visualforce page (overrides Account) when a user does not have access to the tab object.
After reading this page
http://blog.deliveredinnovation.com/2011/02/05/render-visualforce-components-dynamically-based-on-object-level-security/
we used
rendered="{!$ObjectType.myCustomObject__c.accessible}"
Hi Jpaq,
I used the same syntax in my page. But I forget to mention on Board.
Thanks a lot:)
Thanks,
Devendra