[Laszlo-user] dataset ontimeout overloaded

Pablo Kang pkang at laszlosystems.com
Wed Apr 25 15:12:05 PDT 2007


I spent a good two hours tracking down why I was getting two dataset ontimeouts 
when I finally figured out that the event was overloaded. The ontimeout event 
can be sent when setting the timeout attribute (which sends a number) and also 
when the call times out (which sends the dataset).

Here's a simple example demonstrating the problem:

<canvas proxied="false" debug="true">

     <dataset name="mydset" src="http://foobar.timeout"
              oninit="this.setAttribute('timeout', 1000);
                      this.doRequest()"/>

     <handler name="ontimeout" args="ds" reference="mydset">

         // Be careful! ds is the dataset whose request timed out, but
 	// can also be a number when setting the timeout attribute.

         Debug.write('mydset got timeout:', ds);

     </handler>

</canvas>

pablo






More information about the Laszlo-user mailing list