4 Replies Latest reply on Mar 7, 2008 8:17 AM by Bryan Dresselhaus

    MXML Component Layout

    Bryan Dresselhaus Level 1
      Is there a way for MXML Components to inherit their layout based on where you place them in the Main Application?

      For instance, I have the following sample MXML Components:

      ===============
      MXML Component 1 - Name
      <Base class of Component>
      <FormItem label="First Name"><TextInput id="firstName"></FormItem>
      <FormItem label="Middle Name"><TextInput id="middleName"></FormItem>
      <FormItem label="Last Name"><TextInput id="lastName"></FormItem>
      </Base Class of Component>
      ===============


      ===============
      MXML Component 2 - Address
      <Base class of Component>
      <FormItem label="Address"><TextInput id="address"></FormItem>
      <FormItem label="City"><TextInput id="city"></FormItem>
      <FormItem label="State"><ComboBox id="state"></FormItem>
      </Base Class of Component>
      ===============

      ===============
      MXML Component 3 - Donation
      <Base class of Component>
      <FormItem label="Donation Amount $"><TextInput id="donation"></FormItem>
      <FormItem label="Payment Type"><ComboBox id="PaymentType"></FormItem>
      </Base Class of Component>
      ===============

      Is there a way to get all the FormItems in the MXML Components to line up when place in a Form container in the main application like below? I have the problem of the MXML Components needing a base class, usually a container or other DisplayObject, but this screws up the layout in the main application.

      <mx:Form>
      <common:Name/>
      <common:Address/>
      <common:Donation/>
      </mx:Form>

      Thanks,

      Bryan