Vijey
Vijey

Reputation: 6626

Flex 4: parent and owner property of UIComponent

I'm trying to understand the difference between the owner and parent properties of the UIComponent.

<s:Panel id="panOne" title="Success">
     <s:Label id="labOne" text="Hello World!!"/>
</s:Panel>

In the above code, labOne.owner.id returns panOne and labOne.parent.id returns contentGroup.

I understand the owner property refers to the parent container of a component (Label in this case). But what does parent property actually mean? I think it relates to some skin concept which has a with id value of contentGroup.

Could someone give exact difference between these two?

Thanks Jason. There is another link in the link provided by you. It explained these two terms very clearly. That link is: Gumbo DOM Tree API - Functional and Design Specification

I have pasted below the best lines from that page.

The parent of a visual element is the container directly in charge of laying it out. The owner of a visual element is the component that logically owns it. If a Button is in a SkinnableContainer, its parent is the contentGroup while its owner is the SkinnableContainer.

Upvotes: 3

Views: 1991

Answers (1)

Jason Towne
Jason Towne

Reputation: 8050

Flexponential has a pretty article explaining the differences between parent and owner.

Upvotes: 4

Related Questions