Skip to Content

passing parameter to Eventhandler

hi all

i have created a confirmation dialog box which is invoked on selecting a date from the Datenavigator.

the confirmation dialog box does have two buttons viz "yes" & "no".

dependindg on the button chosen by the user i hav to manipulate the selected date. now my problem is with passing that date as parameter to the actionhandler of the button on the dialog box.

the eventhandler i have created does hav parameter named selectedDate but how shall i pass the value since i am not calling that eventhandler in my code.

Thanks in advance

Deepak

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    author's profile photo
    Former Member
    Apr 03, 2008 at 12:26 PM

    Hi,

    Why dont you use the context attribute that is mapped to the date field directly in the event handler as

    wdContext.current<Your elememt>().getdate()

    and then do the rest of the process.

    If this is a different screen try to map the attibute and use.

    Regards

    Ayyapparaj

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Apr 03, 2008 at 12:57 PM

    Adding to Ayyaparaj reply, in properties of DateNavigator, there is property firstSelectedDate and lastSelectedDate. Map those property to a context attribute say, sDate (which must be of type date). So whatever date is selected in DateNavigator will then be mapped to context attribute, sDate.

    Regards,

    Gopal

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Apr 04, 2008 at 04:32 AM

    Hello Deepak,

    You must be using the following code for your requirement.

    IWDControllerInfo contInfo = wdControllerAPI.getViewInfo().getViewController();
       	
    IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow( "String Message", contInfo.findInEventHandlers( "ok"), "Ok");
    dialog.addChoice( contInfo.findInEventHandlers( "cancel"), "Cancel");
     dialog.show();
    
    
    public void ok(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
      {
         // Add this line that will get you the result
       wdContext.currentContextElement().getDateElement();
      }
    

    I don't think you have to pass the date value as parameter

    Regards

    - Vinod

    *

    Add comment
    10|10000 characters needed characters exceeded