1 Reply Latest reply on Sep 30, 2011 5:18 AM by Elmes100

    How do I update datagrid values programmatically

    Ti26E31DSxxx

      Hi - I'm new to Flash and PHP.  I'm using the FlashBuilder with PHP product.  I have a data grid that is connected to a PHP script that retrieves and updates data via the 'Enable Data Management' function.  If I modify data on the grid by using the screen and call .commit(), everything works OK.

       

      However I would like to programmatically change some of the values in the data that underly the grid and have those changes get back to the update function in the PHP script when commit(). is called.  But I can't figure out how to change the underlying data. 

       

      Here's the code I've tried: (the object that I pass back and forth to the PHP script is call MailPiece.  I want to set the WORKORDERNUMBER field on each row of the data)

       

      var gridDataProvider : AsyncListView = dataGrid.dataProvider as AsyncListView;

      var myMailPiece:MailPiece = gridDataProvider.getItemAt(0) as MailPiece;

      var myWorkOrderNumber:String = myMailPiece.WORKORDERNUMBER;

       

      myMailPiece.WORKORDERNUMBER="NEWWO";

      (dataGrid.dataProvider).setItemAt(myMailPiece,0);

       

      trace("about to commit");

      TPP1Service.commit();

       

      When I execute the script code above, I get the following message when the commit() is executed:

      MessageBatch.applyTokenChain : emtpy token cache

       

      Can someone help point me in the right direction?

       

      Thanks,

      Bob