3 Replies Latest reply on Sep 16, 2009 10:12 PM by wbilgrami

    Multiple Form Handling

    wbilgrami

      Hi I am new to Adobe AIR and have .net experience. I have a project where i have around 25 forms. whats the best way to program the forms in Adobe AIR, is there a way where i can keep each form in a seprate file, and call all the files in the main MXML. or do i have to put all the form in one MXML using view stack.

       

      you help is really appreciated.

        • 1. Re: Multiple Form Handling
          adobe_paul Adobe Employee

          Just to be clear, this is really about Flex rather than anything particular to AIR. But it's a good question.

           

          You can definitely define each "form" in a separate file. The most common approach is to create each one as an MXML "composite component." (While it's called a component, you base your "component" on a container so in my mind it's really more of a logical group of several controls -- like a screen or form -- than a "component" in the sense of a single user interface control.)

           

          Once you create an MXML component, you can create an instance of it an another MXML document just by using the tag for it. (If you've done any ASP.NET, it's pretty much the same as ASP.NET composite components i.e. .ascx files.)

           

          You can then for example include your form "components" in a view stack (so you just have a list of tags, each representing one form, rather than needing to include the entire code for every form in one MXML file). Alternately, if they're always replacing each other you can just have a container placeholder defining where the form will go, and just use addChild() and removeChild() to manage which form is visible at any given time. (That's essentially what the ViewStack does -- it just adds extra functionality but also extra overhead, so it depends on what your needs are.)

           

          Some resources to learn more about this:


          MXML Custom Components in the Flex 3 Developer's Guide

           

          Flex Quick Start: Building components in MXML (really, all the articles under the user interface sections of the Flex Quick starts)

           

          from the Flex Getting Started Experience: Customizing components: Composite Component

          1 person found this helpful
          • 2. Re: Multiple Form Handling
            wbilgrami Level 1

            Thanks Paul. It's really helpfull and detailed. love that.

             

            thanks a lot.

            • 3. Re: Multiple Form Handling
              wbilgrami Level 1

              Thanks