Binding in a mediator

hbostic's Avatar

hbostic

06 Nov, 2012 03:42 AM

What's the best practice for auto-updating a view based on changes in the model. Is it appropriate to bind to model properties or is their a better way?

Thanks

  1. 1 Posted by neil on 06 Nov, 2012 09:25 AM

    neil's Avatar
  2. Support Staff 2 Posted by Ondina D.F. on 06 Nov, 2012 09:31 AM

    Ondina D.F.'s Avatar

    Hello,

    In most cases, the recommended way is:

    A Model dispatches a custom event with a VO as a payload when its data changes.
    A Mediator listens for that event and passes the VO on to its View by accessing View’s API.

    Useful reads:

    http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/wha...

    https://github.com/robotlegs/robotlegs-framework/wiki/Best-Practice...

    and, of course, lots and lots of forum-discussions on this topic :

    http://knowledge.robotlegs.org/search?q=model&t=d&scope=all...

    Let us know if it helped you or not. Ask more questions if need be :)

    Ondina

  3. Support Staff 3 Posted by Ondina D.F. on 06 Nov, 2012 09:35 AM

    Ondina D.F.'s Avatar

    Oops, didn’t notice Neil answered already.
    +1 to Neil’s suggestion

  4. 4 Posted by neil on 07 Nov, 2012 02:35 PM

    neil's Avatar

    SPAM ALERT!

  5. Support Staff 5 Posted by Ondina D.F. on 07 Nov, 2012 02:41 PM

    Ondina D.F.'s Avatar

    Thanks, Neil. Spammer removed.

  6. 6 Posted by hbostic on 10 Nov, 2012 12:45 AM

    hbostic's Avatar

    Thank you all for the responses. I'm going with the VO approach right now, mainly because I am in learning mode. Once I get a bit more comfortable with the framework, I will employ the PM design and see what's doin

    Again, thanks

  7. Support Staff 7 Posted by Ondina D.F. on 13 Nov, 2012 10:39 AM

    Ondina D.F.'s Avatar

    You’re welcome!

  8. Ondina D.F. closed this discussion on 13 Nov, 2012 10:39 AM.

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