2 Replies Latest reply on Oct 8, 2007 7:23 AM by zz_james

    controlling view states

    zz_james
      It would be nice to get feedback from a more experienced developer about how I should implement my view with regards to state, on the one hand I have a book (essential flex 2.0 with actionscript 3.0) which explains that view state should be handled using <mx:state> and on the other hand I have the cairngorm examples (cairngorm store and cairngorm login) that use a viewstack.

      I don't think I fully comprehend what the implications of choosing one or the other will be, other than using viewstack looks simpler.

      I would be grateful for any advice. Thankyou

      James
        • 1. controlling view states
          zz_james Level 1
          sorry, it appears that there is exactly this question on 3rd August
          sorry for repost
          • 2. Re: controlling view states
            zz_james Level 1
            from flexcoders on yahoo

            Here's what I'm getting from all the manual reading I've been doing over the past week. Others may correct me or clarify as needed.

            - Think of the base state as the "home page"... it's the initial state of the app or component when the user browses to it. I can't think of a good reason why it would ever be empty unless you wanted to implement some kind of transition or effect immediately upon loading it.
            - In the larger sense of UI design, HTML "pages" are addressed in the Flex metaphor with ViewStacks attached to a navigator. Use this for macro changes in the interface.
            - View states are used to display incremental changes in state. Sounds like you are using that correctly insofar as you describe it... however, depending on how your user interface is designed and what you're trying to accomplish, the "Detail" state you describe could also be just an incremental change to the "Master" state with the Master state remaining visible. Also, the "Master" state could be your base state since it's empty and that's the first thing the user sees.