6 Replies Latest reply on Apr 30, 2011 11:44 PM by wendy888

    Help! why the value does not change?

    wendy888

      in ViewStack at index=0 (home page) , I pass object to placements (index=1) when I click on a datagrid item.  The name on placements has the value that passed from home page.

      when I return to home page and click on another item on datagrid, I want the new value pass to placements page, but the first item data is still on the placements. How to refresh it?


      I need the value (text) of

      TextInput id="txtName"  on placement page changes as I assign at home page.

       

      See below

      [Bindable] public var objPlacementMain:Object = new Object;

       

       

       

       

       

       

      private  function gotoPlacements(event:ListEvent):void{

        

      this.objPlacementMain.name = this.dg.selectedItem.col1;
      this.homePlacement.selectedIndex = 1;
      }


      <mx:ViewStack id="homePlacement">
      <mx:V

      <mx:DataGrid id="dg" itemClick="gotoPlacements(event)">
      <mx:columns>

       

      <mx:DataGridColumn headerText="Column 1" dataField="col1"/>

       

      <mx:DataGridColumn headerText="Column 2" dataField="col2"/>

       

      <mx:DataGridColumn headerText="Column 3" dataField="col3"/>

       

      </mx:columns>

      </mx:DataGrid>

      <h:placements

      objPlacement="{objPlacementMain}" />


      </mx:ViewStack>

       

      at placements


      .......


      [Bindable] public var objPlacement:Object = new Object;

       

      ..........

      <mx:HBox

       

       

       

       

      width="100%" height="30">

       

       

      <mx:Spacer width="48" height="25"/>

       

       

      <mx:Label text="Name " fontWeight="bold" width="51"/> <mx:TextInput id="txtName" text="{this.objPlacement.name }" width="193" editable="false"/>

      </mx:HBox>
      .......