You need to sign in to do that
Don't have an account?
tpasley@yahoo.com
outputLink Tab on refresh
I have simple visualforce page on a custom tab with several outputLinks to other pages. I want the links to keep the same tab highlighted. I have tried using tabStyle to set it to the controller for these pages, but it doesn't work; a different tab is highlighted. Sometimes it's another custom tab and sometimes it's the Home tab. Here is the page:
<apex:page showHeader="true" sidebar="true" tabStyle="My_Reports__tab" title="My Reports" controller="UserReportController" id="MyReports" > <apex:sectionHeader subtitle="Your Reports"/> <apex:pageBlock rendered="{!OR(isPortalUser, isLeadAgent, isTheUser)}"> <div style="margin: 2px; padding: 2px; width: 90%; background: url('{!$Resource.MyLogo}') no-repeat;"> <div style="font-weight: bolder; font-size: larger; margin-left: 150px;"> <apex:outputLink value="/apex/monthlyReport">Individual Organization Reports</apex:outputLink><br/> <apex:outputLink value="/apex/BatchReport">Coalition Report</apex:outputLink><br/> <apex:outputLink value="/apex/TransferVerification">Transfer Verification Report</apex:outputLink><br/> <apex:outputLink value="/apex/UnderConstruction">Summary Report</apex:outputLink><br/> <apex:outputLink value="/apex/UnderConstruction">Progress on Goals Report</apex:outputLink><br/> <br/><br/><br/><br/><br/> </div> </div> </apex:pageBlock> <apex:pageBlock rendered="{!AND(NOT(isPortalUser), NOT(isLeadAgent), NOT(isTheUser))}"> <apex:outputText style="font-weight: bolder;font-size: largest;">You are not authorized to view the reports.</apex:outputText> </apex:pageBlock> <br/> </apex:page>
The <apex:page ... declarations listed above are one per target page.
I.e. when you use a command link of:
your TransferVerification page needs to declare the tabstyle of:
and the same applies to all the other target pages of command links.
All Answers
To keep same tabStyle is to be highlighted put tabStyle attribute with same tabStyle value(My_Reports__tab__c) for all your custom pages listed in output links.
Ex:
-Suresh
I can't have more than one <apex:page> tag on a single visualforce page. I tried adding the For clause for one of the page links, but that also did not work.
The documentation states the following to keep the focus on a custom visualforce tab (which is what I want and which is what I tried to do in the code):
To use a custom Visualforce tab, set the attribute to the name (not label) of the tab followed by a double-underscore and the word tab. For example, to use the styling of a Visualforce tab with the name Source and a label Sources, use tabStyle="Source__tab".
The <apex:page ... declarations listed above are one per target page.
I.e. when you use a command link of:
your TransferVerification page needs to declare the tabstyle of:
and the same applies to all the other target pages of command links.
Perfect. Thanks for the clarification.
Thank you, Suresh, too.