Dealing with a generic 'loader' view

ahmednuaman's Avatar

ahmednuaman

18 May, 2013 07:46 PM

Say I have a model that uses a REST API and a number of different views that use said model, I want to show a loader when those views call methods on said model; what's the best way of telling the application to show this 'loader' view? Should I map all the model's methods to a 'command' and from there add and remove the 'loader' view? Or is that naughty?

  1. Support Staff 1 Posted by creynders on 20 May, 2013 01:51 PM

    creynders's Avatar

    Sorry your post got into the spam queue.

    I never let models communicate with REST api's directly, but use dedicated service classes instead. In general I have a single view which instantiates and removes (or shows and hides) a progress bar, which I use for all async stuff progress feedback. The views mediator listens to the relevant service events and updates the progress bar accordingly. When the process has finished the view removes/hides the progress bar (whatever you prefer)

  2. Support Staff 2 Posted by Ondina D.F. on 10 Jun, 2013 11:34 AM

    Ondina D.F.'s Avatar

    I’m going to mark this discussion as resolved, but feel free to re-open it, should your problem persist.

  3. Ondina D.F. closed this discussion on 10 Jun, 2013 11:34 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