9 Replies Latest reply on Nov 10, 2008 10:12 AM by FrankyG813

    Navigation Question

    FrankyG813
      Here's my dilemma. I am writing an application. I'm trying to create a canvas where the left part of the screen (and possible a top region, that I have not added yet), is for navigational purposes. Currently I've got iconic link buttons. I want to be able to control what's in the center portion of the screen while I want to keep the navigational regions static. I've been looking at states as a possibility, but I'm concerned that I would be overloading my application and thus cause it to take forever to load. Most of the content on the dynamic screens contain grids with data coming from a database. I've seen many applications with regions similar to what I want to create. I just want to know how typically these are handled. Your input would be greatly appreciated.
        • 1. Re: Navigation Question
          Level 7

          "FrankyG813" <webforumsuser@macromedia.com> wrote in message
          news:gencr0$nta$1@forums.macromedia.com...
          > Here's my dilemma. I am writing an application. I'm trying to create a
          > canvas
          > where the left part of the screen (and possible a top region, that I have
          > not
          > added yet), is for navigational purposes. Currently I've got iconic link
          > buttons. I want to be able to control what's in the center portion of the
          > screen while I want to keep the navigational regions static. I've been
          > looking
          > at states as a possibility, but I'm concerned that I would be overloading
          > my
          > application and thus cause it to take forever to load. Most of the
          > content on
          > the dynamic screens contain grids with data coming from a database. I've
          > seen
          > many applications with regions similar to what I want to create. I just
          > want
          > to know how typically these are handled. Your input would be greatly
          > appreciated.

          Try a ViewStack

          HTH;

          Amy


          • 2. Re: Navigation Question
            FrankyG813 Level 1
            Thanks Amy,

            I read up on Viewstacks and found that while all components are NOT visible, they are still there. My concern is that if most of the invisible components are datagrids that have been set up to query a database source, so if I have quite a few of these, then the application might take a bit long to load. Would tabbed containers do the same thing?

            Frank
            • 3. Re: Navigation Question
              Gregory Lafrance Level 6
              By default, only the children of the first ViewStack "view" are actually created when the ViewStack first displays.

              If you set the ViewStack creationPolicy to "all", then you are right, all children of all the ViewStack "views" are created when the ViewStack is first created.

              So ensure creationPolicy is set to auto (default), and populate the DataGrid of each view with the initialize event.
              • 4. Re: Navigation Question
                Level 7

                "FrankyG813" <webforumsuser@macromedia.com> wrote in message
                news:geqd3a$7u8$1@forums.macromedia.com...
                > Thanks Amy,
                >
                > I read up on Viewstacks and found that while all components are NOT
                > visible,
                > they are still there. My concern is that if most of the invisible
                > components
                > are datagrids that have been set up to query a database source, so if I
                > have
                > quite a few of these, then the application might take a bit long to load.
                > Would tabbed containers do the same thing?

                You might want to look at how I handled this in my groupingCollection
                example
                http://flexdiary.blogspot.com/2008/09/groupingcollection-example-featuring.html


                • 5. Re: Navigation Question
                  FrankyG813 Level 1
                  Thank Amy and Greg,

                  Greg, do the creationPolicy rules apply to other container types such as TABBED and ACCORDIAN?

                  Frank
                  • 6. Re: Navigation Question
                    Gregory Lafrance Level 6
                    All containers inherit that property, though it is more relavent with navigation containers like ViewStack, TabNavigator, and Accordion.
                    • 7. Re: Navigation Question
                      FrankyG813 Level 1
                      Thanks !!

                      I tried to experiment with this and created a tabbed container. On an underlying tab, I placed a grid. I also placed a grid on a separate canvas that is viewable when the application loads. Each grid is fed data when I triggered a RemoteObject once the application is loaded. I used a resultHandler to specify the data providers for each of these grids thereby populating them.

                      I get an error when the application loads:
                      TypeError: Error #1009: Cannot access a property or method of a null object reference.

                      However when I add the creationPolicy='all' it works as it should. How can I now get it to populate when navigating to the right tab?

                      Thanks for your help

                      Frank
                      • 8. Re: Navigation Question
                        Gregory Lafrance Level 6
                        You could populate it in the show event handler of the view in each tab.
                        • 9. Re: Navigation Question
                          FrankyG813 Level 1
                          Thanks so much for your answer Greg. I've set up a TabNavigator (within the design view) and noticed that for each tab a Canvas container is created. I created a show event handler for a canvas containing the grid and it works great.