1 Reply Latest reply on May 8, 2007 5:21 PM by ntsiii

    HELP!  DataGrid not displaying data when WebService reloaded

    llupis
      I have a datagrid which gets populated by a webservice call. This works fine. However I am periodically re-calling the webservice to reload the data. When that happens, I see the clock icon for a second and then the datagrid's data is gone. I have tried re-setting the dataprovider with no luck. Any help would be greatly appreciated!!

      ==================
      example code snippet:

      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="100%" initialize="init();">

      <mx:Script>
      <![CDATA[
      import mx.controls.Alert;
      import flash.utils.Timer;
      import flash.events.TimerEvent;

      private var timer:Timer;

      private function init():void {
      this.timer = new Timer(10000);
      this.timer.addEventListener(TimerEvent.TIMER, this.resetNow);
      this.timer.start();
      }


      private function resetNow(event:TimerEvent):void {
      svcPressReleases.getHomePressReleases();
      }

      ]]>
      </mx:Script>

      <mx:WebService id="svcPressReleases" wsdl="xxx...dev_work/cfc/flex_integrate.cfc?wsdl" showBusyCursor="true" result="pressReleasesGrid.dataProvider=event.result">
      <mx:operation name="getHomePressReleases" fault="mx.controls.Alert.show(event.fault.message)" />
      </mx:WebService>

      <mx:DataGrid initialize="svcPressReleases.getPressReleases.send();" id="pressReleasesGrid" x="1" y="1" click="{body.htmlText=mx.utils.ObjectUtil.toString(svcPressReleases.getPressReleases.last Result[pressReleasesGrid.selectedIndex].RELEASETEXT)}" width="490.5" height="158" fontSize="10" headerStyleName="LabelsNews"> Text Text