0 Replies Latest reply on Nov 15, 2010 1:05 AM by ravi burila

    unable to display............

    ravi burila Level 1

      hi

          i tried a small example, where iam unable to display lael field.......

       

      <mx:Repeater

       

       

      id="myRep" dataProvider="{column1}" >

       

       

      <mx:HBox borderThickness="2">

       

       

      <mx:Label text="{myRep.currentItem}" id="processName" width="220"/>

       

       

      <mx:TextInput id="startTime" width="100" />

       

       

      <mx:TextInput id="endTime" width="100" />

       

       

      <mx:TextInput id="remarks" width="100" />

       

       

      <mx:TextInput id="recordCount" width="100" />

       

       

      <mx:Button id="submit" label="ADD>>" click="addTrans(event.currentTarget as Button);"/>

       

       

      </mx:HBox>

       

       

      </mx:Repeater>

       

       

      this is the repeator where iam trying to take an array column1 as dataprovider

       

       

       

      now i want to diaply the above contents both textinput field and label text also

       

       

      public

       

       

      function addTrans(clickedBtn:Button):void{

       

      var parentHBox:HBox = clickedBtn.parent as HBox;

       

      var label_text:String="";

       

      var enteredValues:String="";

       

       

      for each(var control:* in parentHBox.getChildren())

      {

       

      if(control is TextInput)

      {enteredValues += (control

      as TextInput).text + " ";

      }

       

      else if(control is Label)

      {labelText+=(control

      as Label).text+" ";

      }

      }

       

      Alert.show(

      "values entered in text input field by user are "+ enteredValues);

      Alert.show("values entered in text input field by user are "+ labelText);

       

       

      // var process_name:String=(parentHBox.getChildAt(1) as Label).text;

       

      var start:String = (parentHBox.getChildAt(1) as TextInput).text;

       

      var end:String = (parentHBox.getChildAt(2) as TextInput).text;

       

      var remark:String = (parentHBox.getChildAt(3) as TextInput).text;

       

      var count:String = (parentHBox.getChildAt(4) as TextInput).text;

      Alert.show(

      "values entered in text input field by user are " + start + " " + end + " " + remark+" "+count);

       

      Alert.show(

      " "+(parentHBox.getChildAt(1) as Label).text);

       

       

       

       

      but iam unable to display label field content.

      could you please help me

      thanks in advance................

      // var process_name:String=(parentHBox.getChildAt(1) as Label).text;

       

      var start:String = (parentHBox.getChildAt(1) as TextInput).text;

       

      var end:String = (parentHBox.getChildAt(2) as TextInput).text;

       

      var remark:String = (parentHBox.getChildAt(3) as TextInput).text;

       

      var count:String = (parentHBox.getChildAt(4) as TextInput).text;

      Alert.show(

      "values entered in text input field by user are " + start + " " + end + " " + remark+" "+count);

       

      Alert.show(

      " "+(parentHBox.getChildAt(1) as Label).text);

       

       

       

       

      but iam unable to display label field content.

      could you please help me

      thanks in advance................