[Laszlo-user] Strange data-binding behavior

André Bargull a.bargull at intensis.de
Mon Jul 16 09:15:47 PDT 2007


You also asked about anonymous functions for "LzDelegate".
After studying the sourcecode for "LzDelegate", I realized you actually 
just need a simple object to get "LzDelegate" working.
That'd be:
[code]
var obj = new Object();
obj["myfunction"] = function(){ /*function-body*/ };
var del = new LzDelegate( obj, "myfunction" );
[/code]

Or as a short form:
[code]
LzTimer.addTimer( new LzDelegate( {func:function(){
  Debug.write( "Hello World!" );
}}, "func" ), 2000 );
   
var del = new LzDelegate( {func:function(a){
  Debug.write( "argument was:", a );
}}, "func" );
   
del.execute( "Hi, it's me!" );
[/code]

Bye,
André

Yang wrote:
>
> BTW, is there any way to pass an anonymous block of code to a timer
> (instead of creating and naming a method)? And is there any way to
> pass arguments through a delegate (aside from the
> eventSender/eventName)?
>
> Thanks,
>
> Yang 

-- 
Mit freundlichen Grüßen,
André Bargull
Intensis GmbH

Tel.: +49 (0)231 5522-900
Fax.: +49 (0)231 5522-901
E-Mail: a.bargull at intensis.de
________________________________
Intensis GmbH
Ruhrallee 9
44139 Dortmund



More information about the Laszlo-user mailing list