Page 1 of 1
Access to tab names on tab panel
Posted: Tue Mar 01, 2011 10:37 pm
by leatherlips
Using javascript, I'd like to access the name of the tab when it's clicked.
I assume I'd use ontabclick which will have the index, but I"m not sure how to access the specific name of the tab?
Re: Access to tab names on tab panel
Posted: Wed Mar 02, 2011 12:50 pm
by David
There is not a way to get these directly using JavaScript. If you really need to do this, though, you could create an array in JavaScript that maps the tab index numbers to the appropriate tab name.
An easy way to make this maintainable would be to use a bound field to populate the tab names property. You could then bind the same field to a hidden field to get the tab names on the screen where you can read them through JavaScript.
You could split the value on the comma to produce an array of tab names ordered by the tab sequence number.
Re: Access to tab names on tab panel
Posted: Wed Mar 02, 2011 1:00 pm
by leatherlips
Thanks Much!
BTW, in order to use pui.click on a button, does it have to be "visible"? (in my testing that seems to be the case).
Re: Access to tab names on tab panel
Posted: Wed Mar 02, 2011 7:13 pm
by David
I ran a quick test -- it actually does seem to work for me on buttons that are not visible.