tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/553-what-mediator-method-to-override-when-reloading-viewstack-componentRobotlegs: Discussion 2012-06-01T15:12:54Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/151718392012-04-11T10:56:11Z2012-04-11T10:56:11ZWhat Mediator method to override when reloading viewstack component?<div><p>Hi Indrajit,</p>
<p>-In the View’s mediator add an event listener for a custom
event, say „viewsVisibilityChanged“ and a handler
method onViewsVisibilityChanged (). Add an event listener for the
FlexEvent.SHOW in your View.<br>
Within its handler method you can dispatch the custom event
„viewsVisibilityChanged“ and the Mediator can ask for
data within its onViewsVisibilityChanged (), for example it can
dispatch an event to trigger a command that would either call a
Service or access a Model’s method, depending on how you need
to load the new data. In this case the Mediator should have
registered an event listener for the event dispatched by the
Service or Model, after the data has been loaded.</p>
<p>-If the View containing the ViewStack would be mediated, it
could dispatch an event when the selectedIndex changes, and the
ViewStackMediator could redispatch this event to trigger a command
to load the new data for the visible View.</p>
<p>Does that answer your question?</p>
<p>Cheers,<br>
Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/151718392012-04-11T12:46:58Z2012-06-01T15:12:54ZWhat Mediator method to override when reloading viewstack component?<div><p>Thanks for the prompt solution Ondina!</p></div>pingale.indrajittag:robotlegs.tenderapp.com,2009-10-18:Comment/151718392012-04-11T12:47:42Z2012-06-01T15:12:54ZWhat Mediator method to override when reloading viewstack component?<div><p>Thanks for the solution Ondina!</p></div>pingale.indrajittag:robotlegs.tenderapp.com,2009-10-18:Comment/151718392012-04-13T08:40:28Z2012-04-13T08:40:28ZWhat Mediator method to override when reloading viewstack component?<div><p>You're welcome, Indrajit!</p></div>Ondina D.F.