Page 1 of 1

javascript to get an element property?

Posted: Thu Jul 25, 2013 12:53 am
by HowardA
I was looking to get a tabpanel's active tab value using javascript. Is there a way to do this?
I see a getelementvalue to retrieve the value, but not sure how to access other properties of a widget (tabpanel specifically)
Thanks!

Re: javascript to get an element property?

Posted: Thu Jul 25, 2013 9:55 am
by Scott Klement
Something like this should work:

Code: Select all

var myPanel = getObj("TabPanel1");
if (myPanel==null || myPanel.tabPanel == null || myPanel.tabPanel.selectedTab == null) {
   // handle error: tab panel not found, or id is found but is not a tab panel.
}

var myTabNo = myPanel.tabPanel.selectedTab;

// myTabNo is now set to the tab number....
Does that help?

Re: javascript to get an element property?

Posted: Thu Jul 25, 2013 12:06 pm
by HowardA
Yes it does.
Thanks once again Scott!