DALDEI
Posts: 12
|
| Posted: 10/09/2009, 4:19 AM |
|
Using CCS 4.3
I created a TabView with 3 tabs. On the 3rd tab I have a grid control.
When I click on any sorter header it jumps to the first tab.
Is there any way to work around this bug and keep the 3rd tab the active tab ?
Tanks for any suggestions
_________________
David Lee
CTO Nexstra, Inc
dlee@nexstra.com |
 |
 |
DALDEI
Posts: 12
|
| Posted: 10/11/2009, 6:42 AM |
|
I found a way to do this. I have no idea if this is a preferred way or not.
I added a client side _OnLoad function.
In that function I check the URL being passed in and try to deduce if this was a URL from one of the sorters. If so then I set the active tab. The function looks like this :
//_OnLoad @1-9C4F01C0
function _OnLoad()
{
var result = true;
//End _OnLoad
//Custom Code @233-2A29BDB7
// -------------------------
// Write your own code here.
// DAL: Set the active tab coresponding to the sorter link used.
var url = location.href;
// alert(url);
if( url.indexOf("?order_itemsOrder=") > 0 )
tabViewYahooTabbedView.set('activeIndex',3);
else
if( url.indexOf("?package_statusOrder=") > 0 )
tabViewYahooTabbedView.set('activeIndex',4);
// -------------------------
//End Custom Code
_________________
David Lee
CTO Nexstra, Inc
dlee@nexstra.com |
 |
 |
DALDEI
Posts: 12
|
| Posted: 10/12/2009, 4:54 AM |
|
I found the above solution doesnt work well when things get complicated, such as the Page Next links in grid forms, and edit fields.
I did find a workaround which is to use an Update Panel inside each tab which wraps all the inner controls. This works very well when I can get it to work but it can mysteriously fail - I had to rebuild my whole tab page from scratch a couple times because I did something to the project or HTML that caused it to go feet up ...
I tried putting an update panel OUTSIDE the tab which would have made life even easier but that doesnt work at all, the contents of each tab are expanded without any tabbing.
Still looking for the correct "supported" method to do this, I have submitted a support request and am waiting to see what the official answer is, will post here.
_________________
David Lee
CTO Nexstra, Inc
dlee@nexstra.com |
 |
 |
mor
Posts: 119
|
| Posted: 10/12/2009, 9:51 AM |
|
Hi!
1. Add to end of function Panel1YahooTabbedView_start line:
Panel1YahooTabbedView.set('activeIndex', CCGetParam('tab') == '' ? 0 : CCGetParam('tab'));
2. Add to Links new URL parameter "tab" with tab id. For example: tab=1
It works for me.
_________________
Mor ve Ötesi |
 |
 |
DALDEI
Posts: 12
|
| Posted: 10/12/2009, 3:22 PM |
|
Does this work for the Sorters, Navigation (next page) and record updates ?
That was my biggest problem I couldnt resolve easily.
Record updates required server code to add tab=xxx then I could never figure out the record navigation links. Then to make this worse, if I had 2 tabs with 2 different grids, the sorters add parameters on each tap so I ended up woth sorter URL's from ALL the grids in all tabs making it very hard to figure out which was the "active" one.
If I could just set some kind of global variable "This is the active tab" and get to that somehow in the javascript that would work.
_________________
David Lee
CTO Nexstra, Inc
dlee@nexstra.com |
 |
 |
mor
Posts: 119
|
| Posted: 10/13/2009, 4:01 AM |
|
I have Grid only on last tab. Other tabs - text info.
If you want, you can use cookies (count and content of tabs does not matter ):
1. Add to end of function Panel1YahooTabbedView_start line:
Panel1YahooTabbedView.set('activeIndex', CCGetCookie("activetab") );
2. Edit yours tabview.js. Add to end of function _handleActiveTabChange line:
document.cookie = "activetab=" + newIndex;
_________________
Mor ve Ötesi |
 |
 |
MichaelMcDonald
Posts: 640
|
| Posted: 10/15/2009, 4:03 PM |
|
I had a version of CC 4.1 where this was not the case, when you clicked on any form button within tab, you always stayed within that tab. It makes no sense to have it work any other way.
Then I applied an update and the feature no longer worked anymore. I contacted YES support and they told me that returning to the first tab is default behavior. Either I entirely imagined it once worked and tested a project to some length or it actaully did. Either way, it makes no sense with the current behavior it demonstrates and maybe YES could change it on the next release if enough people lobby them directly.
_________________
Central Coast, NSW, Australia.
|
 |
 |
|