on 09-21-2006 10:06 AM
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
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");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
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>");
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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();
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.