cancel
Showing results for 
Search instead for 
Did you mean: 

error external window

Former Member
0 Kudos

Window structure

_______OmWebforms

-


SearchHelpPos_View

Code I am using

IWDWindowInfo win = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("SearchHelpPos_View");

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

window.setWindowPosition(900, 800);

window.open();

errormessage

java.lang.NullPointerException

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.getViewManagerFor(ClientComponent.java:319)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.<init>(WebDynproWindow.java:82)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.<init>(WebDynproWindow.java:93)

at com.sap.tc.webdynpro.clientserver.window.InternalWindow.<init>(InternalWindow.java:32)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createModalWindow(ClientComponent.java:953)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createWindow(ClientComponent.java:942)

at com.shell.teamflow.wd.omwebforms.Positions_View.onActionSearchPosition(Positions_View.java:250)

at com.shell.teamflow.wd.omwebforms.wdp.InternalPositions_View.wdInvokeEventHandler(InternalPositions_View.java:1279)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Cronan,

You have given the view name in the findInWindows method.

so it raises null pointer.

change it into,

IWDWindowInfo win = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("OmWebforms");

Former Member
0 Kudos

Thanks, I now get an new error message

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Duplicate instance exception: The interface view Om_WebformsInterfaceView in component Om_Webforms_Comp is already in use.

at com.sap.tc.webdynpro.progmodel.controller.Component.addUsageOfInterfaceView(Component.java:177)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.<init>(WebDynproWindow.java:79)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.<init>(WebDynproWindow.java:93)

at com.sap.tc.webdynpro.clientserver.window.InternalWindow.<init>(InternalWindow.java:32)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createModalWindow(ClientComponent.java:953)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createWindow(ClientComponent.java:942)

at com.shell.teamflow.wd.omwebforms.Positions_View.onActionSearchPosition(Positions_View.java:250)

at com.shell.teamflow.wd.omwebforms.wdp.InternalPositions_View.wdInvokeEventHandler(InternalPositions_View.java:1279)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)

Former Member
0 Kudos

Hi Cronan,

I think your views Positions_View and SearchHelpPos_view are in the same window(Om_Webforms). if you want to call a view in external window yo should create another one window and embed the view in this new window.

then you should give the new window's name in findInWindows("newWindowName>");

Former Member
0 Kudos

Hi,

Are you trying to open the same window as a child window from the parent window? I don't think you can open the parent window view as part of a child window.

Regards,

Satyajit.

Former Member
0 Kudos

That is right they are. don't I need to use plugs then for the data what should go back and forward from the views

the window is not opening in a new view but in the same view. should be an external window

Former Member
0 Kudos

Hi ,

As per my thoughts the external window will be in second application and data flow on way only.

gothrough once WD_ExcelExport exampple this is also one way passing data.

Thanks

Lohi

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

An external window will have its own minimise, maximise and close options as in the parent window. But, if it is a search help that you wish to implement, then it is a popup itself that you require, with a close button, not an external window.

Regards,

Leena

Former Member
0 Kudos

The requirement is that not a pop-up but an external window is openend. You know if that is possible and which code i need to use.

Should I otherwise make a new project and link the viewname to the external window"?

Where can i Find the Webdynpro_Eventing readyuse code?

Message was edited by: S. Dresen

Former Member
0 Kudos

Hi,

fid this for Wd_Eventing link.

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/19e6e990-0201-0010-eca6-a62e342eaad3

This will for popup only but u can change the some code u can get the External Window and close that.

In Embder Component View controlPanel and button Create component button goto the onAction and impl the following code.

String url ="";

String depObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();

try {

WDDeployableObjectPart depObjectpart=WDDeployableObject.getDeployableObjectPart(depObjectName,"ResultApp",WDDeployableObjectPartType.APPLICATION);

url = WDURLGenerator.getApplicationURL(depObjectpart) ;

} catch (Exception e) {

}

IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(url,"window title",true);

//msg.reportSuccess(attributeName);

window.open();

It will display the external window.

U can close the external win or click the destroy comp button that External window should closed.

Thanks

Lohi.

Former Member
0 Kudos

Thanks lohitha,

how do i integrate these 2 code parts? do i need to make a new project

// IWDWindowInfo win = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("SearchHelpPosition");

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

// window.setWindowPosition(150, 300);

// window.open();

// wdContext.currentExternalWindowElement().setWindowInstance(window);

String url ="";

String depObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();

try {

WDDeployableObjectPart depObjectpart=WDDeployableObject.getDeployableObjectPart(depObjectName,"ResultApp",WDDeployableObjectPartType.APPLICATION);

url = WDURLGenerator.getApplicationURL(depObjectpart) ;

} catch (Exception e) {

}

IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(url,"Search Help Position",true);

// msg.reportSuccess(attributeName);

window.open();

Former Member
0 Kudos

Hi,

Did you seen that Code example and that will be impl in that proj. u will get the External window or not?

Thanks

Lohi.

Former Member
0 Kudos

Hi

What you have now is a popup window, not an external window. To close a popup window, you create an event, and a method to call this event, in the controller. Now, in the action you have created for onSelect of some value in the popup window, you write the code to call the above mentioned method in the controller. Then create an event handler for(for the event created in the controller) in the parent view. In this event handler method, you write the code to close the window (<window instance name>.close)

Regards

Leena

Former Member
0 Kudos

thanks, what do i need to do to let it not be an pop up but a external widow that opens

Former Member
0 Kudos

you probably need to make a new project en then use in the code the reference of the view to open an external window. Don't know for sure, maybe others can confirm this

Former Member
0 Kudos

Hi

Try to See the Webdynpro_Eventing readyuse code.

make some changes then u can get the external window and

u can close it.

Go thru once that.

Thanks

Lohi

Former Member
0 Kudos

Hi,

If it is a search help, then that means that you will be selecting something from that opened window. If that is the case, then create an action for onSelect and in this method you may write the code for setting values to the context nodes and also call the event for closing the window.

Kindly revert back if this is not clear.

Regards,

Leena

Former Member
0 Kudos

Hi

To pass data to and from a newly opened window, you may use the value nodes in the context and do the mapping, not plugs. Plugs are usually used to navigate from one view to another and pass data while doing so.

Regards

Leena

Former Member
0 Kudos

ok thanks. But what about opening an external window. It is a serachhelp. I don't want to close it every time

Former Member
0 Kudos

Hi Cronan,

Check whether the modal argument property of the create window() is set to true.

that is ,

wdComponentAPI.getWindowManager().createWindow(windowInfo, <b>true</b>);

Former Member
0 Kudos

Is it possible that it opens in a new internetexplorer session

Former Member
0 Kudos

How can i close the external window with a action

Former Member
0 Kudos

Hi

U can utilize this code might helps. if u use the window instance.

if (<Windowname> != null) {

Windowname.destroy();

Windowname = null;

}

Thanks

Lohi

Former Member
0 Kudos

Hi

Ur window instance is not created in Webdynpro window .

Create SearchHelpPos_View instance in Wondows.

Create a Window instance and use this code u can get new window. create an WindowInstance attribute and make as com.sap.tc.webdynpro.services.session.api.IWDWindow in one folder. the last stmt is setting to that.

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

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

window.setWindowPosition(300, 150);

window.open();

wdContext.currentPopupElement().setWindowInstance(window);

this might works.

this is for only for popup window not for the external window.

External window means u need chagge the code.

IWDWindow window =

wdControllerAPI.getComponent().getWindowManager().createExternalWindow("URL","String name",false);

window.open();

this only possible create two appliactions and two comp in same webdynpro component.

Thanks

Lohi

Message was edited by: Lohitha M