3 Replies Latest reply on Feb 18, 2009 7:13 PM by atta707

    HTTPService - Datagrid DataProvider


      Basicly here is what I'm trying to do.

      1. Load XML (Through PHP)
      2. Populate Datagrid with data
      3. Use UI button to refresh datagrid with XML

      Load XML,, I'm using HTTPService to load the XML which i generated with and PHP File which is loaded from mySQL. This works fine, I initate an function from creationcomplette in the application tag..like so:

      public function loadData(e:FlexEvent):void{
      test.url = 'test.php';
      test.addEventListener(ResultEvent.RESULT, resultHandler);


      This works great :) The ResultHandler populates the dataprovider of the Datagrid like so:

      public function resultHandler(e:ResultEvent):void {
      myDG.dataProvider = e.target.lastResult.book;


      Which also works great..

      Then I have the button to get the newly inserted "books" in the MySQL that "should" refresh the Dataprovider like so:
      public function reload(e:MouseEvent):void{

      test.addEventListener(ResultEvent.RESULT, resultHandler);


      But here is my problem the only thing that is happening is that the test.send() is fired, but the .lastResult is still the same length and the same object as before even if they have doubled in the PHP (XML) file.

      Could anyone help me please?