4 Replies Latest reply on Apr 28, 2009 11:33 AM by Gregory Lafrance

    new to flex - basic approach question - multiple windows

    Bob in SC Level 1

      Forgive me and i'm sure this is extremely basic so i need a quick pointer on the right way to approach using flex. Is essentially every "page" a new "application". It seems that all the examples and tutorials/docs approach the design as through you have one main application window and a bunch of containers/controls that live on that application. Yes i can do something like have a tabbed view where i only see part of it but if i were to design an app with lots of screens (maybe a wizard that has a next and previous) does each screen need to be a new application and then is there any easy mechanism to move data between applications or is that kind of outside the scope of flex.

       

      what led me to this question is i think i'd like to use a tabbed UI for my application but one of those tab pages has a button that needs to open another window which prompts the user for some information. This is when i became a little confused on how that window is treated -- i.e. do i need to create yet another application and handle the passing of data back to the tabbed window? I do realize that i could use a pop up window and maybe that's the correct approach. Any help you can provide is appreciated.

       

      Bob

        • 1. Re: new to flex - basic approach question - multiple windows
          Gregory Lafrance Level 6

          TabNavigator for main UI, TitleWindow launched as popup using PopUpManager.

           

          See TitleWindow in Flex Builder help sys or LiveDocs.

          1 person found this helpful
          • 2. Re: new to flex - basic approach question - multiple windows
            Bob in SC Level 1

            Greg thanks. So...what would you do if the UI was more complicated. for example if you were trying to build something like this? You wouldn't do each of these buttons as pop ups would you? Or would i create lots of applications.

            • 3. Re: new to flex - basic approach question - multiple windows
              ATIF FAROOQ Level 3

              hi,

                 you can break down your application into smaller parts in flex using many different techniques.It depends on you that how you want to divide your application and what parts need to be separated from main application. The most easisest wat to do is to make components.Which you can calll in your main application when you need them.You can do this From Flex Builder by going to file->new->MXMLComponent.This will open a new Dialog box where you can provide the Container for this component that will hold all other childrens and widht and height of your component.

               

              Then you can simply load this component as PopUp like i.e

               

              ////CustomComponent is the filename of your newly created custom Component

              var myCom:CustomComponent=new CustoComponent()

               

              ////you can pass data to your component by populating public properties in your component like this

               

              //myCom.publicProperty='some thing'

               

              you can also access data from your parent application from within your component by using parentApplication property of your component

               

              PopUpManager.addPopUp(myCom) ///this line will add the component as poupup into your parent Application

               

              in this way you can seperate your popups Logic from your parent Application and do alll the processing for that popup in your customComponent

               

              and you can still pass the data to your component by referencing it into your application. as mentioned above.

              1 person found this helpful
              • 4. Re: new to flex - basic approach question - multiple windows
                Gregory Lafrance Level 6

                It depends on your user requirements.

                 

                You break apps into MXML and ActionScript components, also perhaps modules. You can load other Flex app SWFs into another app if desired.

                 

                Only use popups if user interaction is better served using a new window. ViewStack and Accodion are also useful.