2 Replies Latest reply on Dec 13, 2007 11:29 PM by gdoumenc

    ConstraintColumn in VBox

      Hi everyone,

      Can someone explain me why I'm wrong with this code (doesn't work.. not aligned..) :

      <mx:Canvas width="100%" height="100%">
      <mx:ConstraintColumn id="col1" width="200"/>
      <mx:ConstraintColumn id="col2" width="300"/>
      <mx:Label text=".." left="col1"/>
      <mx:Label text=".." left="col2"/>
      <mx:Label text=".." left="col1"/>
      <mx:Label text=".." left="col2"/>
      tested also with col1:0 and col2:0
        • 1. Re: ConstraintColumn in VBox
          deepa subramaniam (adobe) Level 2
          ConstraintColumn and ConstraintRow objects can only be referenced by the direct children of the Canvas container declaring them. In this case, the VBox. The Label controls are children of an HBox (and grandchildren of the VBox) and have no knowledge of the ConstriantColumns. Additionally, ConstraintColumn/Rows and constraint styles like left/right/top/bottom are only valid in those containers that support absolute positioning.

          Do you want to lay out your Labels side by side? If so, you should remove your left constraints on the Labels and it should lay out correctly. If you're envisioning a more advanced layout, feel free to describe it and I'll try to help you construct the correct layout.
          • 2. Re: ConstraintColumn in VBox
            gdoumenc Level 1
            Many thanks for your help proposal...

            - I understand why it doesn't actually work, but not why Adobe team doesn't make it working.. ? As col1 and col2 are uniquelly identified.. so could be found to respect such constraint...
            (I've seen that this constraint notion seems not very intuitive for some users, I think this can help to have it more..)

            - What I want (and though this approach was a solution) is to have a dynamic list of labelled input text. I want to have those texts aligned in two columns (as in HTML table). As the number of rows is not known, I cannot have constraint rows and use VBox do be able to add such labelled line...