Re: Parent View States Control Child Component View States
Rather than setting up some kind of binding mechanism to the view
state, which still may be better (don't know), I'm doing something
like this, in which a Presenter (controller) puts the View in one of
its view states (using a public method defined on the View's
interface), and the parent loops through its child components to set
their view states to match.
// VIEW STATE Setter -- Called by Presenter to change view state for user
public function setViewState(state:String):void
//Sets parent's view state
this.currentState = state;
//Parent controls child component view states
// TODO: Make recursive to get through various wrapper components
for (var i:String in children)
children[i].currentState = this.currentState;
Using this technique, the children would have to define the same view
states as the parent.
Is there a cleaner way? Is this unnecessarily processor intensive?
Please let me know.