• NatePolo
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
In http://wiki.apexdevnet.com/index.php/Tabbed_Accounts_in_30_seconds
I've done the same for my custom object and it works pretty good.
On mine I have defined  TAB-A, TAB-B, TAB-C
I have extension controller code getting called on one of my extra Tabs (TAB-B) and that works fine too.

However I want it to return the user exactly where they were (in TAB-B) but I cannot find what that tab reference/url is.
It appears to be a Frame with a hidden field (j_id0:CaseTabPanel=TAB-B)

Any ideas on how I'd re-render that back from my controller (via PageReference ?)

Thanks
Lal

Hi all,

I'm pretty new to VF and have been trying to find the right mix of docs to solve my problem, but so far no luck. 

 

I have a VF page with apex:tabPanels for different related lists of my custom object. 

Unfortunately, when I navigate away from the page and come back, the default apex:tab is what is always displayed. Instead, I would like to display the last apex:tab that I was looking at.

 

Currently, the VF editor gives me the error:

Error: Unknown property 'SFDC_Project__cStandardController.ControlTabs'

 

VF Page

<apex:page standardController="SFDC_Project__c" extensions="ControlTabs" showheader="true" sidebar="true"">

<apex:form>
<apex:actionFunction name="setFocus" action="{!TabInFocus}"/>
</apex:form>

<apex:tabPanel width="90%" switchType="client" headerSpacing="5" value="{!TabInFocus}">
<apex:tab label="Project Milestones" id="pjMilestones">
tab 1
</apex:tab>
<apex:tab label="Team Members" id="tmTab">
tab 2
</apex:tab>
<apex:messages />
</apex:tabPanel>

</apex:page>

 

Controller extension:

 

 

public class ControlTabs {
// Get the value for the tab name from the URL. Name is "tab"
String TabInFocus = System.currentPageReference().getParameters().get('tab');
// Constructor
public ControlTabs(ApexPages.StandardController stdController) {
System.debug('Current Selected tab is :' + TabInFocus);
}

public String getTabInFocus() {
System.debug(' *****Current Selected tab is :' + TabInFocus);
return TabInFocus;
}

public void setTabInFocus( String s ) {
System.currentPageReference().getParameters().put('tab',s);
this.TabInFocus = s;
}


}

 

 

Ultimately, I want to be able to track the last tab I looked at and call it up when I view the page. 

I was thinking that I could set the TabInFocus on a onTabEnter or onclick event; hence the apex:actionFunction. 

 

 

I found some posts
that lead me to believe I could get/set the id. However, I think I'm
getting stuck in properly extending the standardController class for my
object. 

 

 

Any and all help would be much appreciated!

 

 

In http://wiki.apexdevnet.com/index.php/Tabbed_Accounts_in_30_seconds
I've done the same for my custom object and it works pretty good.
On mine I have defined  TAB-A, TAB-B, TAB-C
I have extension controller code getting called on one of my extra Tabs (TAB-B) and that works fine too.

However I want it to return the user exactly where they were (in TAB-B) but I cannot find what that tab reference/url is.
It appears to be a Frame with a hidden field (j_id0:CaseTabPanel=TAB-B)

Any ideas on how I'd re-render that back from my controller (via PageReference ?)

Thanks
Lal