1 Reply Latest reply on Sep 14, 2011 3:54 AM by jfb00

    Help with dynamic form

    jfb00 Level 3

      Hi All,

      How can I insert all my labels items into a HBox?

       

      Here is my sample code:

      private function buildForm():void{
                      var numberOfColumns:Number = mainApp.acYears.length; //Multi years array
                      var formItem:FormItem = new FormItem();
                      var hBox:HBox = new HBox();
                      formItem.addChild(hBox);
                      for(var i:Number=0; i< numberOfColumns; i++) {
                          var formLabel:Label = new Label();
                          formLabel.text = mainApp.acYears.getItemAt(i);
                          formItem.addChild(formLabel);
                      }    
                      loansForm.addChild(formItem);
                  }
      

       

       

      Thanks!

      Johnny