on 04-14-2008 11:24 AM
HI Experts,
For closing the window.
I wrote the below code but it gives me the error.
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("VcTempEndDate");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.close();
The below is the error
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Duplicate instance exception: The interface view VcTempEndDateInterfaceView in component VcTempEndDate is already in use.
what could be the problem
Regards,
Naresh
HI Naresh,
Looks like your trying to close window from that window itself.
then create an close.html file and put it into mimes folder
access this file
String url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");
wdThis.wdGetViewController().wdFirePlugExit(url);
in close.html write a javascript which contains following function
<html>
<SCRPT LANGUAGE='JavaScript'>
function win_close()
{
window.parent.opener = top;
window.parent.close();
window.opener.close();
}
</SCRPT>
<body onlod='javascript:win_close()'>
</body>
</html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
If you have created the attribute of type IWDWindow then use the folloowing code:
IWDWindowInfo wininfo = wdComponentAPI.getComponentInfo().findInWindows("VcTempEndDate");
IWindow wind =(IWindow) wdComponentAPI.getWindowManager().createModalWindow(wininfo);
wdContext.currentContextElement().setWindowinstance(wind);
wind.show();
3.onActionClose
wdContext.currentContextElement().getWindowinstance().destroyInstance();
Thanks n Regards,
Jhansi Miryala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Naresh,
Check my edited reply.
You just need to make some changes in close.html
SCRPT to SCRIPT and onlod to onload.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
Inorder to close the Pop-Up window, that is opened by another view (Suppose MainView),
you can:
1. Create a context attribute of type IWDWindow in MainView
2. Map this context to the defalut View in Pop-Up Window.
3. Call the .close() or .destroy() methods on the current element of the context attribute.
Regards,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
try this way:->
For this first we make a Window and Embedd the desired View in this window.
Now Make a method by which we can open the desired window.
Here the method is openWindow
And closeWindow for closing window.
(These methods are inside component controller)
Make a value attribute(windowInstance) inside component controller of type IWDWindow.
public void OpenWindow( ) {
IWDWindowManager winMgr= wdThis.wdGetAPI().getComponent().getWindowManager();
IWDWindowInfo winInfo=wdThis.wdGetAPI().getComponent().getComponentInfo().
findInWindows("FormatWindow");//put your window name here
IWDWindow changeFontWindow=winMgr.createModalWindow(winInfo);
changeFontWindow.setWindowPosition(WDWindowPos.CENTER);
changeFontWindow.setTitle("Change Font Format-Title");
changeFontWindow.show();
//here set the attribute
wdContext.currentContextElement.setwindowInstance(changeFontWindow);
}
public void CloseWinDow( ) {
IWDWindow ins=wdContext.currentContextElement.getwindowInstance();
ins.destroyInstance();
}
IT WILL WORK.
Regards
Trilochan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
How many windows you have?
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("VcTempEndDate");
I think you have one window VcTempEndDate and you are calling VcTempEndDate in itself.
You can not call a window in itself. You need create another window and call it.
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
If you have only one window you can not close it. Exactly what is your requirement? If you close the window then what you want to show then or where you want to navigate?
If you want to show blank screen do like this.
Embed an empty view in your window (double click on your window, in the right panel you have option to embed view ) and on action close just navigate to that view
regards,
Siva
HI Siva,
Its the confirmation screen view.
It will just just display the details in read mode .
I have close window button on it.
Once it is clicked , i just want to close the window.
I am not going to navigate to any where else.
Its the end of my application.
Ayyapparaj: can you explain me how to do this with java script.
And clear steps to do it.
Regards
Naresh
Hi,
Can you explain where this code is placed. Is this written in wdDomodify?
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.