You need to sign in to do that
Don't have an account?
Brendan Lally
How to return to specify sub Tab layout within Tabbed Accounts example
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
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 Saravanan,
Thank you for posting the sample code. Please forgive my ignorance on this but, I still don't think my question has been answered. I believe the post (and your sample code) shows how to get the value of the "{!SelectedTab}" from the controller. However, none of the examples clearly show how to set the value of the selected tab.
Shouldn't there be a javascript event or something that happens when a user clicks on a tab?
I expect to see some apex code with reference to a javascript that sets the value in the URL so that when the user navigates back to the page, the controller can read it and set the "{!SelectedTab}" value.
In comment #11 (http://community.salesforce.com/sforce/board/message?board.id=Visualforce&view=by_date_ascending&message.id=4660#M4660) there's some javascript there, but I still don't see a browser event that triggers the setting of the value.
Obviously, I'm missing something here. Could someone please point it out to me?
Thank you.
All Answers
then in your controller action you can set the value of theSelectedTab property and when the rerender happens the correct tab should be selected.
Thanks for that .
what is the format of my PageRef (I presume 2 invoke the proper tab)
I did have the following
Ta
So how do I do that (if its not a PageRef)
i.e. "..then in your controller action you can set the value of theSelectedTab property and when the rerender happens the correct tab should be selected." 2 get my listingsTab selected
?
ta
and selectedTab refers to the name attribute of your tab.
The bad news, this does not appear to be working with formulas, meaning it needs a String like "Contacts" instead of being able to call into a property on your controller. I'll log a bug for this for my team.
How do I know when this gets fixed?
Does it come with the next major release or do u roll little bug-fixes into prod (I'm in DE and TE editions at moment - about 2 go 2 beta) without us really seeing it?
Is there a way to track this issue (msg id 3659) and I presume this gets tagged to your internal bug tracking system (which I presume we have no visibility into)
Lal
...so I created some example code per your example and exampled from Tabbed Accounts
It displays fine - shows tabs and data etc.. but when I set the 'tab to return to' in the extension controller (can see it getting set ok via a debug statement and also in a pageblock display) it does NOT RETURN to the correct tab.
Help - what am I missing...
Here's the code
and debug output
Thanks in advance.... stumped!!
Lal
As always, this is dangerous as Salesforce functions could change at any time.
Message Edited by Mark Young on 08-25-2008 10:08 PM
Is there a timeframe for when this will be fixed?
The question that never seems to get answered in this thread is "how do you set the {!theSelectedTab} value?"
Looking at the code, I don't see anything that describes how to fire off the method in the controller that sets the value.
I want to be able to set the value when a user click on a tab and then re-read that value when the page loads so that the user's tab session never loses state.
here is the answer with sample code:
Hi Saravanan,
Thank you for posting the sample code. Please forgive my ignorance on this but, I still don't think my question has been answered. I believe the post (and your sample code) shows how to get the value of the "{!SelectedTab}" from the controller. However, none of the examples clearly show how to set the value of the selected tab.
Shouldn't there be a javascript event or something that happens when a user clicks on a tab?
I expect to see some apex code with reference to a javascript that sets the value in the URL so that when the user navigates back to the page, the controller can read it and set the "{!SelectedTab}" value.
In comment #11 (http://community.salesforce.com/sforce/board/message?board.id=Visualforce&view=by_date_ascending&message.id=4660#M4660) there's some javascript there, but I still don't see a browser event that triggers the setting of the value.
Obviously, I'm missing something here. Could someone please point it out to me?
Thank you.
See Keeping track of the selected tab of an apex:tabPanel in the controller for a solution - Keith