Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Using a Timer in refresh View's Mediator hangs

$
0
0

So I'm trying to use a Timer to periodically refresh a view after requesting data from our custom web service.  I got this idea from LaurentSD on a related forum thread.

 

    Auto-refresh behavior of views in the web client

 

I've modified the sample code from custom-property-(provider/ui).  The original custom-property sample code had a button handler that invoked a gson service to request elevation data for a given latitude/longitude.  I implemented my own service class which in turn invokes our own JSON based web service. 

 

I created a flash.utils.Timer, and I start the timer when the View's Mediator calls set contectObject() to clear the data for a new host.  I have a method, updateTimer, that is an event listener on the Timer, and is called for each timer interval.  The updateTimer has logic to try to call our web service every 5 seconds.

 

The mediator has a method that requests the data for our service (aka, the button handler to get sample elevation data).  Now I've tried to call this same method, getResponseData(click:MouseEvent), from the updateTimer handler.  So the request goes out, the data comes back from the web service, the view TextArea is updated with the result, but the UI hangs.

 

For the click argument, I tried a few things.  Using null for click, creating a new MouseEvent.click with bubbles turned off.

 

Has anyone else tried to solve a similar problem?


Viewing all articles
Browse latest Browse all 219257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>