2 Replies Latest reply on Jan 17, 2007 8:02 AM by WestSide

    Viewstack and custom components...

    WestSide Level 1
      Hi,

      I have a viewstack with an id of say "myViewStack" Code is below. I then have a function and do this:

      appViewStack.selectedChild=home; or whatever...

      I guess i am referencing the container sorta like a switch statement of different views that I can change by using the selectedChild functionality? That is how I am doing it, and I am not sure if that is right although it seems to work *so far*

      Any help appreciated.

      I am getting an error that "globalBar" used more than twice. This is a common toolbar I want to use and want it to appear in all views/screens in the app. How can I do this and not have the redundant code.

      Within that I have this code

      <mx:Canvas id="home">
      <comps:globalToolBar id="globalBar" width="100%" />
      </mx:Canvas>


      <mx:Canvas id="Issues">
      <comps:globalToolBar id="globalBar" width="100%" />
      </mx:Canvas>

      Thanks

      -Westside
        • 1. Re: Viewstack and custom components...
          QuickStick Level 1
          Westside,

          Can't tell you for sure whether the selectedChild code is correct, but I'm using it too, and haven't had any problems with it yet.

          Is there any reason you can't rename the id on the second page?

          E.g:

          <mx:Canvas id="home">
          <comps:globalToolBar id=" globalBar1" width="100%" />
          </mx:Canvas>


          <mx:Canvas id="Issues">
          <comps:globalToolBar id=" globalBar2" width="100%" />
          </mx:Canvas>

          I'd confidently say that Flex won't allow you to have two objects with the same ID. Solely, because you can't access them both from one name.

          Hope that helps.

          Oz.
          • 2. Viewstack and custom components...
            WestSide Level 1
            Hi,

            Thats what I did.

            Thanks

            -Westside