2 Replies Latest reply on Dec 27, 2011 12:48 PM by saisri2k2

    how to refresh AdvancedDataGrid in flashbuilder 4, getting data from webservice

    m_woot

      I have tried many things like below to get my grid updated when it gets data from webservice ,

      myGridName.ValidateNow(), 
      myGridName
      .InvalidateList(),
      if(myGridName.updateCompletePendingFlag)

      the problem is I have two buttons that can show hourly, and daily data in one grid, when activating daily button, I got the data in the grid but with delay of maybe 2 to 5 seconds(to get data from webservice) and within this period if user clicks on hourly button, to see the hourly data, then user will see the daily data attached to the end of the hourly data in the grid, please notice that there is just one grid. the problem is I don't know how much to wait for the first set of data to show up on the grid (daily data) and then enable all other buttons so user can only just choose Hour button when all the daily data has been shown in the grid, so when user click on hour button, the daily data will not attached to the end of hourly data in the grid.

      any help is appreciated

        • 1. Re: how to refresh AdvancedDataGrid in flashbuilder 4, getting data from webservice
          saisri2k2 Level 4

          I would disable other buttons when i'm expecting the data from the server.since they are async i would re-enable the buttons once the result event or fault event are handled.  you dont have to guess the response time here, you disable othre buttons whn one of the 2 buttons is clicked. and enable in the result evnt.

          • 2. Re: how to refresh AdvancedDataGrid in flashbuilder 4, getting data from webservice
            m_woot Level 1

            Thanks for the answer,

             

            I do disable other controls when one of the buttons are clicked and waiting for the data, and  in my retrieved data function from webserver , at the very end after I retrievd all the data from webserver and add it to the dataprovider of the grid, I enable all the controls, but the problem is in reality , I see that all other controls are enabled sooner than I see the data show on the grid, and because of that user can think there is no data in the grid and click on the hour buttons , causing that  the daily data to be attached to the hourly data in one grid.

             

            I appreicate if you could still help me