Message 1 of 3
FInd the Parent Component of a Component

Not applicable
01-02-2017
07:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to find the parents component of a component (usually the root but sometimes components are nested). Is there a method to find this given a reference to the component? I don't quite understand the language around Occurrences to know if you can find the parent occurrence using methods like comp.allOccurrencesByComponent() to access parent occurrences and then their components.
I could do this using breadth first search, getting the children of the root component and searching its children and their children untill I find my component then go up a level, but I wonder if there is a constant time method for doing this?