||View All MessagesBack to WebFX|
I was looking into the switch/case statement that Erik pointed out and it occured to me: since we have to identify each of the tab-pane objects on the page with an "id", then it seems redundant to have such a switch statement because it has to be modified each time the id values or number of tab-pane objects is changed.
Instead, is there a method along the lines of, say,
or something which loops through the tab-panes and sets the active one by its name rather than its index?
Or, even simpler, what about just a way to loop through all the id's and return the index of the id that matches the method argument such as
so that we can do:
and therefore not having to have a bunch of case statements at all?
How can we loop over all the tab-panes and get their IDs and their indices?
From: Erik Arvidsson
Sent: January 22, 2004
Subject: Re:TabPane onLoad event
Why don't you use setSelectedIndex instead?
See the main page for the tab pane article and notice how the links switches the selected tab.