Proper way to open window second time, after closing it once [message #1346183] |
Sat, 10 May 2014 13:35 |
Jeyhun MAMEDOV Messages: 21 Registered: March 2014 |
Junior Member |
|
|
Hi I have problem with opening window second after closing it once
The code
EModelService mds
MApplication app
MTrimmedWindow wnd = (MTrimmedWindow)mds.find("my.window.id", app);
if (wnd == null) return;
wnd.setVisible(true);
wnd.setToBeRendered(true);
mds.bringToTop(wnd);
runs only once. after window has been closed, this code do not work.
my fix is to clone window and assign parent of main window where code
runs to cloned one.
EModelService mds
MApplication app
MWindow mainWind
MTrimmedWindow wnd = (MTrimmedWindow)mds.find("my.window.id", app);
if (wnd == null) return;
MTrimmedWindow mtw = (MTrimmedWindow)mds.cloneElement(wnd, wind);
mtw.setParent(mainWind.getParent());
mtw.setVisible(true);
mtw.setToBeRendered(true);
mds.bringToTop(mtw);
I seems to me that it is a hack, and I do not like it.
Is this a proper way? May be I should add something to onCloseHandler to
second window for to just hide it, not close (free).
|
|
|
Powered by
FUDForum. Page generated in 0.03109 seconds