Window close listener is not working for closing a Window

682 views
Skip to first unread message

raj

unread,
Jul 21, 2010, 10:52:12 AM7/21/10
to GWT-Ext Developer Forum
Hi All,

I am facing problem on Close listener in GWT-Ext Window .
com.gwtext.client.widgets.event.WindowListener, it is having all
override methods for Window. When onclose of Window it is calling
onClose () method and
onbeforeClose() methods.
the problem is i am not able to close that window, but it is calling
those two methods,
the code I am using is:
window.addListener(new WindowListener() {
@Override
public boolean doBeforeClose(Panel panel) {
// TODO Auto-generated method stub
jsTerminateVideoWindow(fVideoId);
panel.clear();
return true;
}

@Override
public void onClose(Panel panel) {
// TODO Auto-generated method stub
window.hide();
window.clear();
panel.destroy();
jsTerminateVideoWindow(fVideoId);
panel.clear();
}

-----
----more methods we have to override
----

Any body knows this issue please provide me a solution.

Thanks in advance,

Raj.

Patrizio De Michele

unread,
Jul 21, 2010, 11:40:24 AM7/21/10
to gwt...@googlegroups.com
emh in the onClose method the window has been closed so it's
 a nonsense to clear the window...etc....what are you trying to do???
calling a panel.destroy() maybe generates a javascript error....
try to catch exceptions....inside the onberforeclose and in the onclose...
in the beforeclose made your things and if everything is satisfied return true...
in the onClose i recommend to do nothing....and not overriding it...
beware also to not make javascript errors in the jsTerminateVideoWindow
(to be sure you can surround with a try-catch)....
consider also that first is called the beforeclose and if it returns true is called
the onclose....
ciao Pat


2010/7/21 raj <rajend...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "GWT-Ext Developer Forum" group.
To post to this group, send email to gwt...@googlegroups.com.
To unsubscribe from this group, send email to gwt-ext+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-ext?hl=en.


rajendra dasari

unread,
Jul 22, 2010, 12:42:30 AM7/22/10
to gwt...@googlegroups.com
Thanks for giving suggetion,
I am sorry Pat, first i tried like that only, for reference what are all methods i am using those
are all are showing in that code,
I think by mistakenly your understanding i am using calling close and after clear panel.
I used these methods separately.

---
Raj
Reply all
Reply to author
Forward
0 new messages