PDA

View Full Version : window events


trish05
07-08-2005, 07:40 AM
I am new to laszlo and would appreciate any help here...

I have a window where a user types in text and I want to clear out the text when the window is closed... I cannot seem to find any event like 'onclose'...

i tried setting focusable=true and calling the onblur event... but it didn't work.


pls help!

ankitrastogi
02-13-2006, 07:41 PM
Hi Laszlo Team,

Its on the same lines. Please provide us the update or substitute of onclose event . I have done with onvisible though but thats not the right way I need to capture when the window has been closed..

Thanks,
Ankit.

Geoff2010
02-14-2006, 08:32 PM
The easiest way to accomplish this is to override the close() method of the window.


<window>
<method name="close">
//do some stuff here
super.close();
</method>
</window>

ankitrastogi
02-15-2006, 08:11 PM
Thanks Geoff,

It works.

Still on the same lines. I have to instatiate multiple instances of a class extending windows to create no of command windows on my GUI . Each window has to be associated with unique dataset on opening and the dataset should get destroy on window close.
But datasets can be at the library or canvas level.
Currently I created one dataset at library level and its contens persist even on window close.

So Is there any to create and destroy them on the fly assocting each with a window creation (var d=new win(); here win is the class defined).


-Ankit

Geoff2010
02-16-2006, 06:24 AM
As long as you are running at least laszlo 3.1 you can have a dataset embedded in a class. Along those same lines, you can use the recursive destroy() method of any object in laszlo to free up the memory and resources.

Here is a quick example... please take note of the "special" xpath you need to use to reference the local dataset.


<class name="myCoolWindow" extends="window">
<dataset name="myData">
<data>blah</data>
</dataset>

<method name="close">
super.close()
this.destroy()
</method>

<view datapath="local:this.myData:/data/text()"/>
</class>

ankitrastogi
02-18-2006, 08:06 PM
Thanks again Geoff ,

I will try this. I am using laslzo 3.1.1 but datasets are remote over http.

Ankit.