4 Replies Latest reply on Jul 19, 2010 7:56 AM by mfriasv

    Advice on changing views

    mfriasv Level 1

      Hello,

       

      I need some advice on changing views. I am building an application where the user goes from one page to another. For example, if the login is successful the login page disappears and redirects to "View tables", if user clicks here on edit go to "edit table", etc.

       

      I am confused on what would be the best approach. I read that using modules would be an alternative. But then there is also view stacks. Which one should I use? If I understood right modules are suitable for big applications. Mine will be rather small though.

       

      Thanks,

      Manolo

        • 1. Re: Advice on changing views
          rootsounds Level 4

          You may want to read up on view States.


          • 2. Re: Advice on changing views
            mfriasv Level 1

            Thanks for your quick answer. I read about states. Is this appropiate for my requirements? I mean, the examples I saw are about changing the appareance of small sections (like the login/register example). What I want to do is change the whole page and this page will include a good bunch of code. That's why I discarded it from the beggining.

             

            But then, I might be wrong...

            • 3. Re: Advice on changing views
              UbuntuPenguin Level 4

              I would use the ViewStack component.  States vs Viewstacks can sometimes be a preference thing.  But for me I see it like this , if the bulk of the view is unchanging , use a state.  An example is a login view , where a failed login leads to view increasing in height to display the error text.  On the other hand , when I feel that the change in view is equivalent to a whole new page , like what the user goes to after successfully logging in , I use view stacks.  An example of this would be something like this

               

              <Viewstack>

                <Login View />  // Purpose of this view is for logging in.  It's events and components are generally confined to it.

                <Clothes View /> // View concerns clothes

                <Purchase Page /> // View holds the purchase data , allowing the user to buy items.

               

               

              If this post was helpful please mark it as such.

               

              Sincerely ,

                Ubu

              1 person found this helpful
              • 4. Re: Advice on changing views
                mfriasv Level 1

                Thanks for your reply,

                 

                I think I will try ViewStack with custom components which seems to be a good solution. However, I wonder if somebody can tell me in what case modules would be more suitable? Does it depend only on the size/complexity of the application or is there any other factor to take into account?

                 

                Manolo