0 Replies Latest reply on Oct 17, 2006 8:35 AM by gclements

    selectedItem Problem

    gclements
      the problem I am having involves the code pasted below.

      I am getting the warning messages (Data binding will not be able to detect changes when using square bracket operator. For Array, please use ArrayCollection.getItemAt() instead.)

      this is refering to the lines of code for the text boxes which have the data from the selected item in the datagrid loaded into them.

      the part which is causing the warning is text="{grid.selectedItem[1]}" (note: the date field has to be a number as the datafeed I am using the separate fields are not named, normally would use grid.selectedItem,somename but not possible in this instance)

      if I use {grid.selectedItem.1} it gives a 1084:syntax error: expecting rightparen before .1. so there for changed it to {grid.selectedItem[1]} which got rid of the 1084 but gave me the warning.

      is there something I am missing or a way round this, or am I just going to have to live with this warning

      any feedback would be greatly appreciated.

      Thanks

      Gavin


      <mx:Panel layout="absolute" left="10" right="10" top="10" height="517">

      <mx:DataGrid id="grid" right="10" left="10" top="10" bottom="200">
      <mx:columns>
      <mx:DataGridColumn headerText="Name" dataField="1"/>
      <mx:DataGridColumn headerText="Date" dataField="2"/>
      <mx:DataGridColumn headerText="Category" dataField="3"/>
      <mx:DataGridColumn headerText="Competition" dataField="5"/>
      <mx:DataGridColumn headerText="Venue" dataField="6"/>
      <mx:DataGridColumn headerText="Type" dataField="8"/>
      <mx:DataGridColumn headerText="ID" dataField="9"/>
      </mx:columns>
      </mx:DataGrid>

      <mx:Text x="10" y="291" text="ID:" fontWeight="bold"/>
      <mx:Text x="96" y="291" text="{grid.selectedItem[9]}" width="139"/>

      <mx:Text x="96" y="317" width="140" text="{grid.selectedItem[1]}"/>
      <mx:Text x="10" y="317" text="Name:" width="59" fontWeight="bold"/>

      <mx:Text x="10" y="343" text="Date:" width="44" fontWeight="bold"/>
      <mx:Text x="96" y="343" width="141" text="{grid.selectedItem[2]}"/>

      <mx:Text x="10" y="369" text="Category:" fontWeight="bold"/>
      <mx:Text x="96" y="369" width="139" text="{grid.selectedItem[3]}"/>

      <mx:Text x="10" y="395" text="Competition:" fontWeight="bold"/>
      <mx:Text x="96" y="395" text="{grid.selectedItem[5]}"/>

      <mx:Text x="10" y="421" text="Venue:" width="44" fontWeight="bold"/>
      <mx:Text x="96" y="421" text="{grid.selectedItem[6]}" width="139"/>

      <mx:Text x="10" y="447" text="Type:" width="61" fontWeight="bold"/>
      <mx:Text x="96" y="447" text="{grid.selectedItem[8]}" width="139"/>

      </mx:Panel>