javascript to get an element property?

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
HowardA
Profound User
Posts: 29
Joined: Fri Feb 08, 2013 8:34 am
First Name: howard
Last Name: Arner
Company Name: Citco Sys
State / Province: Georgia
Country: United States
Contact:

javascript to get an element property?

Post 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!
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: javascript to get an element property?

Post 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?
HowardA
Profound User
Posts: 29
Joined: Fri Feb 08, 2013 8:34 am
First Name: howard
Last Name: Arner
Company Name: Citco Sys
State / Province: Georgia
Country: United States
Contact:

Re: javascript to get an element property?

Post by HowardA »

Yes it does.
Thanks once again Scott!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 13 guests