PDA

View Full Version : Another Window question 2... the sequel!



jvahabzadeh
4 Nov 2011, 6:21 AM
(ok first off, I should really ask, is there another forum that's more appropriate for me to ask questions about GXT 3.0 stuff and how to use certain classes, or should I continue to post the questions here?)

I see in the Explorer demo that when the Window class is used, it's displayed with show() (and hidden with hide())... and essentially the browser window owns it (I guess it's a child of the HTML body, but I don't know).

However, I've been trying things where the Window objects I create are added to a panel.

This seems to do what I want for the most part. However, the close button does not work - presumably because it will call hide() rather than getting a parent to remove itself from.

So, how do I add a listener or handler for this? In a similar way that I can do Window.addMinimizeHandler() so that I can handle minimization, is there something similar for when the close icon is clicked?

Or would this require my own subclass of Window?

sven
4 Nov 2011, 6:44 AM
(ok first off, I should really ask, is there another forum that's more appropriate for me to ask questions about GXT 3.0 stuff and how to use certain classes, or should I continue to post the questions here?)
I moved it for the post forum for now, as this is not a bug report but a question.

However, I've been trying things where the Window objects I create are added to a panel.

This is not yet supported.


This seems to do what I want for the most part. However, the close button does not work - presumably because it will call hide() rather than getting a parent to remove itself from.

You can make the window not closable and add the close tool on your own. Than you can run any logic you want it to run.

jvahabzadeh
4 Nov 2011, 8:12 AM
However, I've been trying things where the Window objects I create are added to a panel.
This is not yet supported.
Ah. Thanks. Is the intent to support this in the future, or is it not intended that a Window can be added to a Container?

sven
4 Nov 2011, 9:13 AM
There are already changes in the show method, so that the window does not get added to the rootpanel directly. However, some more.

The hide method by default also removes it from the parent already. What problem do you have exactly, is there an exception? Have you setup a brakepoint to see why it does not "do anything"?

jvahabzadeh
4 Nov 2011, 9:34 AM
No exceptions, just mistaken assumptions on my part. I had assumed that the close button would call hide(). And also assumed that hide() was very explicitly dealing with removing from the RootPanel in the way that show() was adding to the RootPanel.