13 Replies Latest reply on Sep 15, 2008 3:18 PM by r_josh4u

    Page load on action

    KManchikalapudi
      Hi,
      Am new to flex and I did not find any examples for the scenario...

      Problem: I created login.mxml (using mx:Application component as root element) and dashboard.mxml (mx:Canvas as root element) pages. On login.mxml submit, i need to open dashboard.mxml and close login.mxml

      I tried using 'PopUpManager.createPopUp(this, dashboard, true)' but it opens as popup instead in the same page.

      I appreciate if someone can suggest me to fix.
        • 1. Re: Page load on action
          r_josh4u
          Hi,

          I am also new to Flex and even I am having the same question. I tried using navigateToURL(url, "_self"); and it somehow worked .. is that the correct way of doing. Can someone please advice.

          I appreciate for your answer.

          Thanks,
          josh
          • 2. Re: Page load on action
            riesvantwisk Level 1
            First, there is never a absolute correct way of doing things in any programming language and design. So your method using navigateToURL could be awell good in your situation. Just make sure the servers session holds the data to know if a user was logged in or not and check that in your next swf.

            I can tell you how I do it...

            My main application is pretty much empty but I load additional functions using module loader- I do have a login module that get's loaded first. Then after a successful login I load one or more needed for the user to show.

            Ries
            • 3. Re: Page load on action
              Level 7

              "riesvantwisk" <webforumsuser@macromedia.com> wrote in message
              news:gakfht$2ag$1@forums.macromedia.com...
              > First, there is never a absolute correct way of doing things in any
              > programming
              > language and design. So your method using navigateToURL could be awell
              > good in
              > your situation. Just make sure the servers session holds the data to know
              > if a
              > user was logged in or not and check that in your next swf.
              >
              > I can tell you how I do it...
              >
              > My main application is pretty much empty but I load additional functions
              > using
              > module loader- I do have a login module that get's loaded first. Then
              > after a
              > successful login I load one or more needed for the user to show.

              Many applications use a ViewStack with different components in the different
              panes of the ViewStack.


              • 4. Re: Page load on action
                KManchikalapudi Level 1
                Amy,
                I appreciate if you suggest me how to do it...

                My server is webservice based. Therefore, it cannot hold session.

                Thanks
                Krishna
                • 5. Re: Page load on action
                  KManchikalapudi Level 1
                  Ries
                  I appreciate if you suggest me how to do it...

                  Thanks
                  Krishna
                  • 6. Re: Page load on action
                    Level 7

                    "KManchikalapudi" <webforumsuser@macromedia.com> wrote in message
                    news:galrh5$huk$1@forums.macromedia.com...
                    > Amy,
                    > I appreciate if you suggest me how to do it...
                    >
                    > My server is webservice based. Therefore, it cannot hold session.

                    Try opening the Help and look under "ViewStack." I'm sure that's much
                    better than what I could write for you in 1 minute. If you're still having
                    problems, come back with specific questions.


                    • 7. Re: Page load on action
                      r_josh4u Level 1
                      Ries,

                      Is there any example that I can refer to about handling the sessions in Flex.

                      Josh.
                      • 8. Re: Page load on action
                        Level 7

                        "r_josh4u" <webforumsuser@macromedia.com> wrote in message
                        news:gam1np$or6$1@forums.macromedia.com...
                        > Ries,
                        >
                        > Is there any example that I can refer to about handling the sessions in
                        > Flex.

                        If you use a ViewStack, it will still be the same session.


                        • 9. Re: Page load on action
                          ntsiii Level 3
                          Further, it sounds like you may be trying to build an HTML application using Flex. Html apps are "stateless", requiring sessions to maintain continuity between page requests. Flex apps are stateful. As Ries says, there is no one way, but typicaly Flex apps do NOT use navigateToURL(), but rather use navigation and container components like ViewStack, as Amy suggests. Since a Flex app never "refreshes" its page, it can keep its own data.

                          Tracy
                          • 10. Re: Page load on action
                            KManchikalapudi Level 1
                            My appliation has 4 different views based on RoleType (Super admin, Admin, user, & reports).

                            Loading all role dashboard mxml under viewstack and enable based on roletype. Is a good approach?

                            My background is Java and our application is developed using struts & webservice. To provide Rich look we are migrating to Flex and webservice is live. In JSP / ASP, we do use request dispatcher or forward to screen based on roletype.

                            I think, there should be similiar way because flex is mixture of JSP/ASP, VB, PHP, etc.

                            Pls correct me if am wrong...

                            • 11. Re: Page load on action
                              ntsiii Level 3
                              This assertion: "...flex is mixture of JSP/ASP, VB, PHP," is completely wrong and is contributing to your confusion. Flex is a stateful RIA, and is closer in design considerations to a desktop app than to an html app.

                              This approach, "Loading all role dashboard mxml under viewstack and enable based on roletype" is completely valid, and a typical architecture.

                              If your application is very large, you can make the base application SWF smaller, thus faster loading (but only significant on first download since subsequent accesses will use locally cached swf) by using modules, or SWFLoader.

                              Both of those bring a signficant level of complexity, and issues of their own, so consider carefully before going that route.

                              Start with a normal component architecture. You can alwys break up into separate modules or apps when required.

                              Tracy
                              • 12. Re: Page load on action
                                Level 7

                                "KManchikalapudi" <webforumsuser@macromedia.com> wrote in message
                                news:gambc1$697$1@forums.macromedia.com...
                                > My appliation has 4 different views based on RoleType (Super admin, Admin,
                                > user, & reports).
                                >
                                > Loading all role dashboard mxml under viewstack and enable based on
                                > roletype.
                                > Is a good approach?
                                >
                                > My background is Java and our application is developed using struts &
                                > webservice. To provide Rich look we are migrating to Flex and webservice
                                > is
                                > live. In JSP / ASP, we do use request dispatcher or forward to screen
                                > based on
                                > roletype.
                                >
                                > I think, there should be similiar way because flex is mixture of JSP/ASP,
                                > VB,
                                > PHP, etc.

                                No, Flex is simply another way of creating a swf. It can access all of
                                those things, but none of them are any part of Flex.


                                • 13. Re: Page load on action
                                  r_josh4u Level 1
                                  Tracy and Amy,

                                  Thanks for the reply, let me try with ViewStack.

                                  -Josh