cancel
Showing results for 
Search instead for 
Did you mean: 

IWDWindow do not get destroy completely!!!! Please Help

Former Member
0 Kudos
63

I Created a IWDwindow, when i close it, the window does not get closed completely leaving a tiny small area on the screen, as it's modal, i cant do anything else. anyone know why?

here's how i create the IWDWindow


try {
                        IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("ErrorPopupWin");
                        
                        IWDWindow window = this.wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
                        wdContext.currentContextElement().setErrorWindowInstance(window); 
                           
                        window.setWindowPosition(WDWindowPos.CENTER);
                              
                        window.show();
                           
                        Thread.sleep(100);
                        
                     } catch (InterruptedException e) {
                           e.printStackTrace();
                     }

and here's how i close it


wdContext.currentContextElement().getErrorWindowInstance().destroyInstance();

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

i find out when this is happening, but still dont know why.

i put this create window method in my Controller.

if the view call this method, the pop up disappear perfectly

but when it's called within the controller, when it get closed, it left a tiny little area on the screen.

any advice?

Former Member
0 Kudos

Hi,

Try the following code..It will help you

********This is to create the window******************************

//@@begin showPopup()

IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("WindowName");

// create the u201CWindowu201D

IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);

// set the WindowPosition on the screen

window.setWindowPosition(25, 25);

// and show the window

window.show();

// Save WindowInstance in Context

wdContext.currentGroupPopupElement().setWindowInstance(window);

***********This is to destroy the window****************

IWDWindow window = wdContext.currentGroupPopupElement().getWindowInstance();

window.destroyInstance(); //Destroy the window instance

Regards

Padma N

Former Member
0 Kudos

Hi,

For a modal window you can try the following code with the position and the size modifications as per your requrement:

creating a window


 IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("Window Name");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.setWindowSize(300,300);
window.show();
	
wdContext.current<Node Name>Element().setWindowInstance(window);

for destroying window intance


WDWindow window = wdContext.current<Node Name>Element().getWindowInstance();
    
    window.destroyInstance();

Former Member
0 Kudos

hi,

you can even try this code.

This works fine for me. May be this will help you also.

IWDWindowInfo info = wdComponentAPI.getComponentInfo().findInWindows("PopUpWindow");

IWDWindow window = wdComponentAPI.getWindowManager().createWindow(info , true);

window.setWindowPosition(WDWindowPos.CENTER);

wdContext.currentContextElement().setVa_win(window);

window.open();

Thanx.

Former Member
0 Kudos

Hi,

What is that sleep delay for. It should work fine without any problem as your code seems to be good. Just try removing that sleep statement and give it a try.

Regards,

Murtuza