Good pracices

greenbudh's Avatar

greenbudh

24 Dec, 2013 09:26 PM

Hello,

If a view is added to stage a mediator is created.
Now, how do you populate the view with data, if you dont inject model inside the view.

  1. Support Staff 1 Posted by Ondina D.F. on 27 Dec, 2013 09:00 AM

    Ondina D.F.'s Avatar

    Hello,

    Sorry for the late response. I'm actually on vacation, so, here, just a quick answer:

    1. classical way
      Mediators listen for events dispatched by a Model when its data changes.
      Mediators can access their Views through their APIs when they receive the event, passing a payload with a VO containing the data needed by the view.

    2. inject models into mediators, as interfaces

    3. use viewProcessorMap

    https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...

    Discussions on this forum about viewProcessorMap:
    http://knowledge.robotlegs.org/search?q=viewprocessormap&recent...

    Hope that helps.
    Ondina

  2. Ondina D.F. closed this discussion on 22 Jan, 2014 03:27 PM.

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