loaded config data to a not yet registered view in state?
Hi
Im new to robotlegs, using flash builder, and started out with the
flickr gallery example.
My application consist of some view components in states, so when
im loading the config xml, my first view which is registred on
stage get the data, however the view in the other states does not
get this. I get the logic about this, but to let the other view get
this data? I would like to learn it the best way, so I dont start
hacking my way around!! on my viewMediators I have this:
eventMap.mapListener( eventDispatcher, ConfigEvent.CONFIG_LOADED, onConfigLoaded )
so the view allready on on stage gets registred and the data,
how to get the other viewMediators get this data?
thanks
pete
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Michal Wroblews... on 29 Jul, 2011 12:11 PM
Are you updating currentState before setting a config in the model? The most probably the view is added right after the event dispatch. If you want to know what happens first set breakpoints under Mediator's onRegister and model dispatching CONFIG_READY event.
But I'd recommend you a custom EventMap created by @Stray. RelaxedEventMap will complete mediator listeners even if your event has just been dispatched. Complete description is in readme under the link..
Thanks,
Mike
2 Posted by freelife on 30 Jul, 2011 01:24 PM
hi Mike
No, im chaning the currentState after.
It´s like the Flickr gallery example, where you would add another page where its mediator gets onRegistret on changePage event. This added page also wants to access the config data.
I was looking at the RelaxedEventMap, but diden´t get it, I will give it a try!!
cheers pete
Ondina D.F. closed this discussion on 02 Nov, 2011 06:11 PM.