WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 TabPane > Preselecting?, ForgetFoo, March 3, 2004
     Re:TabPane > Preselecting?, Emil A Eklund, March 3, 2004
         Re:TabPane > Preselecting? , Guillermo, March 10, 2004
             Re:TabPane > Preselecting? , Erik Arvidsson, March 14, 2004
         Re:TabPane > Preselecting?, Erik Arvidsson, March 4, 2004
         Re:TabPane > Preselecting?, ForgetFoo, March 3, 2004
             Re:TabPane > Preselecting?, Emil A Eklund, March 4, 2004

Subject: Re:TabPane > Preselecting? From: Guillermo Date: March 10, 2004

Mmmm... maybe I'm doing something wrong, I have:

<script type="text/javascript">
tp1 = new WebFXTabPane( document.getElementById( "tab-pane-1" ) );
var str = document.location.search;
var index = str.substring(1, str.length-1);
tp1.setSelectedIndex(document.location.search);
</script>

But when I pass the variable in the url, "my_tabbed_page.html?2" it doesn't slect the third tab, it throws an error...

From: Emil A Eklund
Sent: March 3, 2004
Subject: Re:TabPane > Preselecting?

Hey foo, how are you doing?

I doubt you can specify which tab should be selected when the tabstrip is created, however as soon as it has the setSelectedIndex method can be used to change the selection.

Assuming you just want to pass the tab index, and nothing else, the following code be used:

var str = document.location.search;
var index = str.substring(1, str.length-1);
tp1.setSelectedIndex(document.location.search);

so file.ext?3 would select the 4th tab (zero-index)

/Emil
---------------------------------------------------------

quick question:
i have a page with 2 tabs defined, and if i pass in a server-side variable i'd like to "preselect" a tab? i have them setup with the js calls like:
<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage2" ) );</script>
so if i pass in a value via a hidden form input or threw the URL, i'd like to "select" this tab... know what i mean?
thanks man, appreciate it! :)
/foo
http://www.forgetfoo.com/





Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX