Josh,

(also coming from a non-Cairngorm guy)

I find it helpful to distinguish between presentation models and data
models, and that's a way that status flags etc. need not be regarded as
"pollution". Just put them in a separate object. There's no rule that says
views can only have a reference to one non-local object. Just like the data
model, the presentation model(s) may or may not actually be shared by more
than one view. A reference can be passed along with events and used by the
controller. Having said that, I don't disagree that there may be a place for
a more generic way for the controller to notify the view. I believe PureMVC
has some sore of Notifier.

- RIchard

On Thu, Jun 19, 2008 at 5:37 PM, Josh McDonald <[EMAIL PROTECTED]> wrote:

>   Disclaimer: I don't use Cairngorm or UM, so I might be wrong! But I do
> take a keen interest in all that is Flex :)
>
> Basically, in Cairngorm, from your View, you dispatch an event telling your
> command to do some stuff, and then you wait for the model to change before
> the view knows to take some action (like say mark the data as saved
> on-screen, or close a dialog, etc). Which eventually leads to your model
> being polluted with things like status flags, feedback, and other sneaky
> things that are really just a back-door direct coupling between command and
> view that shouldn't really be in your model.
>
> When you build a UMEvent, before you dispatch it you say something like
>
> myEvent.successCallback = this.thingsWereDoneHandler;
> myEvent.failCallback = this.somethingWentWrongHandler;
> dispatchEvent(myEvent);
>
> And the UM extensions will keep track of your event, and anything that is
> kicked off by the command, and will call back into your view object to let
> it know the success / failure of whatever you may have initiated.
>
> -Josh
>
> On Fri, Jun 20, 2008 at 10:27 AM, donvoltz <[EMAIL PROTECTED]> wrote:
>
>> Thanks for your responses.
>>
>> I agree with the idea that binding should work, I have set up 2
>> datagrids with the same data provider, the standard data grid works
>> fine  when the model locator is updated, however, the advanced one
>> does not. Is it because I am using a grouping tag with the advanced
>> data grid that the refresh() is needed or should this work with
>> binding as well?
>>
>> Also, I have looked at the UM Cairngorm. It looks interesting but a
>> little beyond me. Do you have any recommendations for getting more
>> information on using this than what is supplied at google code?? I do
>> not understand the idea of event hooks.
>>
>> Thanks again for the useful information
>>
>> Don
>>
>>
>> ------------------------------------
>>
>> --
>> Flexcoders Mailing List
>> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>> Search Archives:
>> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
>> Links
>>
>>
>>
>>
>
>
> --
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
>  
>

Reply via email to