tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/355-loaded-config-data-to-a-not-yet-registered-view-in-stateRobotlegs: Discussion 2018-10-18T16:35:30Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/89370772011-07-28T18:27:44Z2011-07-28T18:27:46Zloaded config data to a not yet registered view in state?<div><p>Hi<br>
Im new to robotlegs, using flash builder, and started out with the
flickr gallery example.<br>
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:</p>
<pre>
<code>eventMap.mapListener( eventDispatcher, ConfigEvent.CONFIG_LOADED, onConfigLoaded )</code>
</pre>
<p>so the view allready on on stage gets registred and the data,
how to get the other viewMediators get this data?<br>
thanks<br>
pete</p></div>freelifetag:robotlegs.tenderapp.com,2009-10-18:Comment/89370772011-07-29T12:11:30Z2011-07-29T12:13:46Zloaded config data to a not yet registered view in state?<div><p>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.<br>
But I'd recommend you a custom EventMap created by @Stray. <a href=
"https://github.com/Stray/robotlegs-utilities-RelaxedEventMap">RelaxedEventMap</a>
will complete mediator listeners even if your event has just been
dispatched. Complete description is in readme under the link..</p>
<p>Thanks,<br>
Mike</p></div>Michal Wroblewskitag:robotlegs.tenderapp.com,2009-10-18:Comment/89370772011-07-30T13:24:23Z2011-07-30T13:24:24Zloaded config data to a not yet registered view in state?<div><p>hi Mike</p>
<p>No, im chaning the currentState after.<br>
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.<br>
I was looking at the RelaxedEventMap, but diden´t get it, I
will give it a try!!</p>
<p>cheers pete</p></div>freelife