on 09-07-2007 6:49 AM
Hi all,
I am trying to implement the pdf (Handling Transactions with BAPIs in Web Dynpro)It is giving an error while creating DialgBoxes
The error is
Error stacktrace:
java.lang.NullPointerException
at com.sap.tc.webdynpro.clientserver.window.ConfirmationDialogDelegate.<init>(ConfirmationDialogDelegate.java:58)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createConfirmationWindow(ClientComponent.java:926)
at com.sap.tut.webdynpro.tutorial.FlightBookingView.onActionBookFlight(FlightBookingView.java:169)
at com.sap.tut.webdynpro.tutorial.wdp.InternalFlightBookingView.wdInvokeEventHandler(InternalFlightBookingView.java:280)
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:100)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:299)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:635)
The code of BookFligh method is
public void onActionBookFlight(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionBookFlight(ServerEvent)
wdContext.currentBapi_Flight_Checkavailibility_InputElement().setAirlineid(wdContext.currentBooking_DataElement().getAirlineid());
wdContext.currentBapi_Flight_Checkavailibility_InputElement().setConnectionid( wdContext.currentBooking_DataElement().getConnectid());
wdContext.currentBapi_Flight_Checkavailibility_InputElement().setFlightdate( wdContext.currentBooking_DataElement().getFlightdate());
wdThis.wdGetFlightBookingCustController().executebapi_CheckAvailibility();
if(wdContext.currentReturnElement().getType().equals("S"))
{
IWDConfirmationDialog dialog;
String dialogText="The Flight Is available";
dialog=wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,
wdControllerAPI.getControllerInfo().findInEventHandlers("Reserve"),"Reserve Flight");
dialog.addChoice(wdControllerAPI.getControllerInfo().findInEventHandlers("Book"),"Book Flight");
dialog.addChoice(wdControllerAPI.getControllerInfo().findInEventHandlers("Cancel"),"Cancel Flight");
dialog.open();
}
else
{
wdComponentAPI.getMessageManager().reportSuccess("Type val is"+wdContext.currentReturnElement().getType());
wdComponentAPI.getMessageManager().reportWarning("The Flight is not booked"+
wdContext.currentReturnElement().getMessage());
}
//@@end
}
Can anyone tell me where the error is???
Regards
Padma
Padma,
Just confirm that the name of the event handler is exactly the same(case sesitive);
If it's same then try this option it is actually the same what you wrote down but you can give it a try
wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("Reserve");
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It is giving error at line 169 of Bookingviewjava" menas at
dialog=wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,
The following code is
wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("Reserve"),"Reserve Flight");
dialog.addChoice(wdControllerAPI.getControllerInfo().findInEventHandlers("Book"),"Book Flight");
dialog.addChoice(wdControllerAPI.getControllerInfo().findInEventHandlers("Cancel"),"Cancel Flight");
dialog.open();
}
else
{
wdComponentAPI.getMessageManager().reportSuccess("Type val is"+wdContext.currentReturnElement().getType());
wdComponentAPI.getMessageManager().reportWarning("The Flight is not booked"+
wdContext.currentReturnElement().getMessage());
}
//@@end
}
Regards
Padma
Hi,
I created actions called
<b>Name EventHandler Text</b>
Book onActionBook Book
BookFlight onActionBookFlight BookFlight
Reserve onActionReserve Reserve
Cancel onActionCancel Cancel
i mapped BookFlight to <b>button</b> Book at Event-onAction...
so how the code has to be modified to resolve that error..??
Regards
Padma
Padma,
wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("<b>OnActionReserve</b>"),"Reserve Flight");
dialog.addChoice(wdControllerAPI.getControllerInfo().findInEventHandlers("<b>OnActionBook</b>"),"Book Flight");
dialog.addChoice(wdControllerAPI.getControllerInfo().findInEventHandlers("<b>OnActionCancel</b>"),"Cancel Flight");
dialog.open();
}
else
{
wdComponentAPI.getMessageManager().reportSuccess("Type val is"+wdContext.currentReturnElement().getType());
wdComponentAPI.getMessageManager().reportWarning("The Flight is not booked"+
wdContext.currentReturnElement().getMessage());
}
//@@end
}
Regards,
Murtuza
Have you created Event handlers Reserve Book and Cancel?
Is that in the same case?
Ashu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.