Skip to Content
avatar image
Former Member

Problem with confirmation popup window

Hi experts.

I'm presently trying to create some popup window, but I can't manage to find how to.

I've tried some SDN tutorials, and have had lots of deprecated functions problems.

But I've found this tutorial, which fits with the version I use (CE 7.11) : [New Features of Web Dynpro Popup Window - SAP NetWeaver CE 7.11|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a04870c5-749b-2b10-06ba-d25515ef39e3]

Inside it, a code is given (page 7) :

//@@begin javadoc:onActionOpenConfirmation(ServerEvent)
/**
* Declared validating event handler.
*
*@param wdEvent generic event object provided by framework
*/
//@@end
public void onActionOpenConfirmation( com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent ) {
//@@begin onActionOpenConfirmation(ServerEvent)
IWDConfirmationDialog window = wdComponentAPI.getWindowManager()
.createConfirmationWindow(infoText.toString(),
wdThis.wdGetCloseAction(), "Close");
window.addChoice(wdThis.wdGetCancelAction());
if (wdContext.currentContextElement().getHasCloseIcon()) {
window.setOnClose(wdThis.wdGetCloseAction());
IWDAction action = wdControllerAPI.getAction("Close");
window.setOnClose(action);
}
window.setWindowSize(500, 200);
window.show();
//@@end
}

In fact, when I click "organise imports", I have two choices :

com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog;

or

com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog;

But:

the "com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog;" import gives me some errors I haven't managed to resolve :

see screenshot : [http://imgur.com/4tBoA.png|http://imgur.com/4tBoA.png]

the "com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog;" import gives me lots of deprecated erros :

see screenshot :[http://imgur.com/xeb18.png|http://imgur.com/xeb18.png]

My question is : do you have an idea what to do to make to given code work ?

Thank you for advance.

Regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 04, 2009 at 10:52 AM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      In fact, the way to finish the tutorial is to first create all the context node and attribute in the Controller Context, then to bind the needed context node and attributes in the context of the file that need them.

      This have solved every problems I had.

      Now it works perfectly !

  • avatar image
    Former Member
    Sep 10, 2009 at 09:52 AM

    Hi expert,

    You can Try thid way................

    firstly before you create popup window ,you have to create one eventHandler method then you will create one confirmation window.

    let assume eventhander method create as action method creation.

    all method declared In View Controller..........

    EventHandler method---OK

    action method--OkDilog

    public void onActionOkDilog(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

    {

    String dialogText = "Your confirmation.";

    // Get Event Handler Info

    IWDEventHandlerInfo eventHandler = wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("OK");

    //Create the confirmation dialog, with an "ok" button

    WDConfirmationDialog window=wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,eventHandler,"OKk");

    wdThis.wdGetCloseAction(), "Close");

    window.addChoice(wdThis.wdGetCancelAction());

    if (wdContext.currentContextElement().getHasCloseIcon()) {

    window.setOnClose(wdThis.wdGetCloseAction());

    IWDAction action = wdControllerAPI.getAction("Close");

    window.setOnClose(action);

    }

    window.setWindowSize(500, 200);

    window.open();

    window.show();

    One thing...

    Ok handler method you make it blank and put any code in that...after clicking confirmation window button it will executed ...........

    thanks

    jati

    }

    Add comment
    10|10000 characters needed characters exceeded