General information
Category:
Object Oriented Programming
Title:
Child object accessing property on parent object?
I have an object (oParent), which has a property named oChild. Once oChild is instantiated, it needs to read some properties from the parent to do his work.
I can't just pass in the values as params to the child in his init() because the parent property values may change during the workflow, and the passed values will then be incorrect.
I can't say "this.parent" from the child, because it just doesn't work.
The only remedy I can think of is to pass a reference to the oParent into the oChild, then oChild will need to store that in a oParent property on himself so he can work from there to get the property values he needs. That just seems unnecessarily complicated in some regards, but that's the only way I can see it working.
Any other ideas?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only