7 Replies Latest reply on Dec 3, 2009 8:53 AM by paul.williams

    Why are the labels inconsistent?

    Jerry62712 Level 1

      I have a series of form items that have the label on the left and others that have the labels on the right.  There are no CSS statements.  I have three questions.

       

      1) Why are the labels justified differently?

       

      2) Is it possible to position the labels to the top or bottom?

       

      3) In Flex Properties (design view) there are positioning indicators under the Text area under Style - how do you use them?

       

      TIA,

      Jerry

        • 1. Re: Why are the labels inconsistent?
          paul.williams Level 4

          Can you post an example and have you read the following page on Form layouts:

           

          http://www.adobe.com/livedocs/flex/3/html/help.html?content=layouts_08.html

          • 2. Re: Why are the labels inconsistent?
            Jerry62712 Level 1

            Thanks for the link.  Here is the form/item that the label is aligned to the right:

             

                                <mx:Form id="searchCriteria"
                                    backgroundColor="white"
                                    horizontalCenter="0">
                                    <mx:Label id="lblHeading"
                                        text="Search Criteria"
                                        fontWeight="bold" fontSize="16" />
                                    <mx:Text id="txtInstructions"
                                        text="Select the SODC and at least one other search criteria." />

            Here is the form/item that has the label aligned to the left:

                        <mx:Form id="gForm"
                            x="35" y="101"
                            horizontalCenter="0"
                            width="716" height="476">
                            <mx:Label id="gHeader"
                                text="Guardian"
                                fontSize="15"
                                width="178"
                                x="5" y="0"/>

                            <mx:Canvas id="gCanvas"
                                height="400" width="619" borderStyle="outset">
                                <mx:FormItem id="gFirstMiddleName"
                                    label="Guardian Of"
                                    y="5" x="5"
                                    width="275"
                                    horizontalAlign="right" fontFamily="Verdana">
                                    <mx:TextInput id="GUARDIANOF"
                                        text="{dmSearch.RecProcess.FIRSTNAME} + ' ' + {dmSearch.LASTNAME}"
                                        change="dmSearch.RecProcess.GUARDIANOF=GUARDIANOF.text; lcConnector.setDirty();"
                                        width="140"
                                        maxChars="50"/>
                                </mx:FormItem>

            Thanks for your time,

            Jerry

             

            [edit:  Thanks to your focusing me, I was able to see that moving the canvas allowed right alignment.  I still have the questions concerning other placements of the label.  The doc indicates that horizonal and veritcal have the same results so that isn't it:

            vertical

            Flex positions children vertically to the right of the FormItem label.

             

            horizontal

            Flex positions children horizontally to the right of the FormItem label.

            ]

            • 3. Re: Why are the labels inconsistent?
              paul.williams Level 4

              What are your remaining questions?

              • 4. Re: Why are the labels inconsistent?
                Jerry62712 Level 1

                Is it possible to position the form item label above the input field.  I can do it by putting a separate label, but I was wondering about the "native" label to the form item.

                • 5. Re: Why are the labels inconsistent?
                  paul.williams Level 4

                  I don't think this is supported by FormItem. I have seen custom extensions of FormItem that achieve a vertical layout, but I don't know of any public examples.

                  • 6. Re: Why are the labels inconsistent?
                    Jerry62712 Level 1

                    Thanks.

                     

                    What I've found is you can't position form items side by side and still have the label right justified.  The minute you put in a canvas, panel or hbox to do that, the label on the form item becomes left justified.  Nor able to put in one on the top.

                     

                    I guess what I have to do is explicitly put in a label with the input item inside the form item.

                    • 7. Re: Why are the labels inconsistent?
                      paul.williams Level 4

                      Yes, unfortunately the Form classes are extremely limited from a layout perspective, but they do give you some advantages from an accessibility perspective.

                      1 person found this helpful