This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 9, 2011, 8:10 AM
30 Posts
topic has been resolvedResolved

Getting the parent ID/component from a select item?

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: parent,parentNode,id
  • Replies: 3
 I need to get the parent of a, in this case, select item.
 
In the value of a component I can use: this.id, but not from a select item as this just get's me the ID of the select item. 
 
 
Any takers? (using Server Side Javascript)
 
 
 
Thanks! 
 
 
/J 
Mar 9, 2011, 8:37 AM
21 Posts
Re: Getting the parent ID/component from a select item?
The individual values of the Select don't have component ids. 
getComponent("listBox1").getValue();  //returns the value of the selected entry.
 
Mar 9, 2011, 8:41 AM
261 Posts
Re: Getting the parent ID/component from a select item?
Hi,
 
Try using the getParent() function to get the parent of a component.
 
For instance: if you have a button inside a panel, the "this" object in the (serverside) onClick event references the event. this.getParent() is a reference to the button and this.getParent().getParent() to the panel. So to get the ID of the panel you'd have to use

this.getParent().getParent.getId()
 
Mark
Mar 9, 2011, 2:28 PM
30 Posts
Re: Getting the parent ID/component from a select item?
 Excellent! getParent did the trick!
 
 
Thanks! 
 
 
/J 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal