1

I am having an application in which I have added one Tab in it also it has a default Home Tab.

Now I need to open up another visualforce page on a button click.

I have used PageReference here :

    public PageReference GoToMasterPage(){
        PageReference pr = new PageReference('/apex/MySecondPage');
        pr.setRedirect(true); 
        return pr;
}

whenever it gets executed it opens up correct VF page but, the focus always shifts to Home Tab which was present by default.

I do not want the focus to shift to the Home tab or any other tab. I it need to focus on the currently selected tab itself.

How can I achieve this?

3

If the new tab which you created is a visual-force tab than add tabStyle attribute in page tag in your MySecondPage page. So the page code would be like :

<apex: page tabStyle="TabName__tab">
   <!---page code-->
</apex:page>

If the tab related to custom object then:

<apex:page tabstyle="CustomObject__c">
  <!---page code-->
</apex:page>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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