on 07-06-2007 5:23 PM
Hi
Can any tell me how create a popupwindow when we select a row in Table? I reffered popup windows tutorials and coded but its giving null pointer exception.
Can anybody help me?
Hi,
Can you please paste your code here?
Thanks and Regards
Avijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avijit Dhar
This is my code
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI
.getComponentInfo()
.findInWindows("PopupWindow");
// create the ?PopupWindow?
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
// set the WindowPosition on the screen
window.setWindowPosition(300, 150);
// and show the window
window.open();
// Save WindowInstance in Context
wdContext.currentPopupElement().setWindowInstance(window);
I placed this code inside Onlead select action.
I also reffered tutorials sent by Ashwin. I followed same.
Please suggest me if there is any mistake in code.
HI Ashvani
My code in first view is
public void onActionleadselect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionleadselect(ServerEvent)
// Window PopUp Window
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI
.getComponentInfo()
.findInWindows("PopUp");
// create the PopUp Window
IWDWindow window = wdComponentAPI.getWindowManager().createWindow( windowInfo, true);
// set the WindowPosition on the screen
window.setWindowPosition(300, 150);
// and show the window
window.open();
// Save WindowInstance in Context
wdContext.currentPopUpElement().setWindowInstance(window);
//@@end
}
My stack trace is
java.lang.NullPointerException
at com.stepan.comp.DashBoardView.onActionleadselect(DashBoardView.java:172)
at com.stepan.comp.wdp.InternalDashBoardView.wdInvokeEventHandler(InternalDashBoardView.java:204)
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.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
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:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
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:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Add a "Close" button to the view that is embedded in your popup window. Assign an action "ClosePopup" to this button and put the code in the action handler.
Put the node "PopUp" in a controller that is visible from both views, the view where the popup is opened and the popup view itself. This can be achieved by putting the node into the component controller context and mapping it from both view controllers.
Armin
I hope you are referring to the tutorial at following location:
Most probably the value read by you from Table is not correct and it is null. Hence the null pointer exception is coming.
Did you tried the application is at following location: [It is application from same tutorial] It works perfect
Regards,
Ashwani Kr Sharma
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.