Skip to Content
avatar image
Former Member

ErrorStack Trace while creating DialogBoxes

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 07, 2007 at 05:56 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Sep 07, 2007 at 05:55 AM

    Have you created Event handlers Reserve Book and Cancel?

    Is that in the same case?

    Ashu

    Add comment
    10|10000 characters needed characters exceeded