function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chris BarryChris Barry 

Setting selectedTab via $CurrentPage.parameters

I'm trying to get this to work...

<apex:page standardController="Account" showHeader="true" tabStyle="account" > {!$CurrentPage.parameters.tabFocus} <br/><br/> <apex:tabPanel switchType="client" escape="false" selectedTab="{!$CurrentPage.parameters.tabFocus}" id="tabPanel" > <apex:tab label="Details" name="AccDetails" id="tabdetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Contacts" name="Contacts" id="tabContact" > <apex:relatedList subject="{!account}" list="contacts" /> </apex:tab> </apex:tabPanel> </apex:page>

 ...by requesting this URL: https://c.cs1.visual.force.com/apex/TabbedAccount?id=15DigitAccountId&tabFocus=Contacts

I know {!$CurrentPage.parameters.tabFocus} works, because it displays "Contacts".
And the selectedTab attribute works great if I hard-code it to "Contacts".

But the combo does nothing. Is this disabled because of Cross site scripting attacks? Or am I missing something? Any help appreciated.

At the end of the day, I'm trying to set the focus of a tab in a tab panel in this VF page when returning from a different page in the app.

Thanks,

cb
Message Edited by Chris Barry on 03-18-2009 12:10 PM
Best Answer chosen by Admin (Salesforce Developers) 
Feng_WFeng_W

Hi Chris, probably this might help

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=1534

 

i am working on this issue as well, but my page redirect to a VF standard page

All Answers

Feng_WFeng_W

Hi Chris, probably this might help

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=1534

 

i am working on this issue as well, but my page redirect to a VF standard page

This was selected as the best answer
yagnayagna

I had the same issue, solution perfectly suits my requirement.

 

Use "Value"  attribute instead of "selectedTab" attribute. The latter only helps setting default landing tab.

 

Thanks,

Yagna

Message Edited by yagna on 05-21-2009 01:58 PM
OyeCodeOyeCode

Just do this 

 

selectedTab="{!$CurrentPage.parameters.tab}"

 

instead of 

 

value="{!$CurrentPage.parameters.tab}"