3 Replies Latest reply on Dec 8, 2009 7:06 PM by P.o.l.a.c.o

    Modify View with Cairgorm


      Hi all,


      I would like to share with you my concern.


      I'm using Cairgorm and based on user gestures i need to update the 'visible' and 'enabled' property of some ui controls.


      My question is:

      Which is the better way to do that?

      I mean, i should do that in the Command classes that are in charge to handle the request or

      i should define all the needed properties in the ModelLocator object and bind the ui properties with the model properties?





        • 1. Re: Modify View with Cairgorm
          P.o.l.a.c.o Level 1

          I have also wondered myself what is the best practice to this... (and still wondering)

          From my little experience I have seen that it's quite useful to define a variable on the ModelLocator and then bind the state of the component to that. Or maybe you could check the state of a variable on the model locator and if it's equals to a desired value turn them visible/invisible or disable.

          So when some user gesture takes place a comand updates that watched variable.

          • 2. Re: Modify View with Cairgorm
            Alex Uhlmann Level 3

            You might want to learn about some options on how to retrieve, constrct and isolate objects here and here.

            • 3. Re: Modify View with Cairgorm
              P.o.l.a.c.o Level 1

              Hi Alex,


              Thanks for the recommended lectures. I have read them and trying to asimilate them.

              About the "Options in Loose Coupling" article I wonder if you could tell me (or provide another lecture/example) what are those "PM" objects and which relation they have with the mentioned Presenter objects.


              This is a whole world to me and differs a bit with the Cairngorm 2 architecture I used to see.

              From what I understood this PM objects are another intermediate layer between the presentation layer (Flex components in this case) and the model locator's hosted domain objects. And the Presenter object handles the status of the current view that should being displayed in the application.

              Did I understood everything wrong?


              thanks for your help.