Skip to Content
avatar image
Former Member

closing POPUP window repeatedly

I am facing an issue when generating popups multiple times in webdynpro. Basically a popup to confirm action has to be generated. The steps are:

1. I have created a window/view - WINDOW1 and VIEW1 and assigned the view to the window.

2. In the component controller, I call window WINDOW1 using IF_WD_WINDOW->CREATE_WINDOW( ) based on user action.

3. In WDINIT of the view VIEW1, i create a popup window using IF_WD_WINDOW->CREATE_WINDOW_AS_POPUP( ) with 2 buttons (Yes and No) and subscribe 2 actions to this window. The actions are created in VIEW1.

4. in both actions, after required logic, i close the window using the following reference

   lo_window = wd_this->wd_get_api( )->get_embedding_window( ).

   lo_window->close( ).

5. On executing, the first time, i see the popup window, i click on yes/no and the window closes.

6. On executing again, the WINDOW1 appears on top of the popup window. (blank popup over confirm action popup).

How do I create a popup window from CONTROLLER with actions to close the window - as we cant assign actions in a controller. Is there anyway to avoid the WINDOW1 on display and just display the popup to confirm?

Regards

Vikram

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Oct 29, 2013 at 10:10 AM

    Hi vikram ,


    can you elaborate your requirement more ..

    as per my understanding on button event (click event )  you want to  open  confirmation window .

    so in that button event you can write code to create pop up and open it

    2 events has to be assign to pop up buttons (ok / cancel )..

    for closing i don't think so u need to write code in cancel event .

    just create event for cancel button and leave it blank ..pop up will get close.

    hope this will help you.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 29, 2013 at 04:36 PM

    Hi Vikram,

    Take a look at the document, The Four Types of Popup Window. There you can see examples of creating the different types of popups including a popup to confirm.

    Cheers,
    Amy

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 30, 2013 at 09:56 PM

    Hi,

    Component controller is used to control the logic to share information across different windows and views inside a Webdynpro component.

    Views form the interface of an application. This means that the interface plugs used in interface views

    are required for user interaction. So the user has to do something on the interface view to interact with the component. This means that the user has to first interact with the view and not the Component controller unless it is a faceless component.

    What I would like to point out is that you have to use the popup to confirm only in the hook methods of the view. Please do not use component controller for your problem.

    I recommend the following for a simple basic level understanding of popups:

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bbbbf6-4fec-2e10-4fa1-b57866732ee0?QuickLink=index&overridelayout=true

    Please try it.

    Another link since it is unclear on what kind of popup is required. Some built in methods:

    http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/wdp_displaypopup.htm

    I can give logic with screenshots on how I have used it but I am sure you will find the link above, useful.

    Your feedback will be most awaited.

    Regards

    Anurag

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 31, 2013 at 06:59 AM

    Hi Vikram,

    Once you got reference in lo_window of if_wd_winow in component controller then you don't need to call method CREATE_WINDOW_AS_POPUP again view.

    You just play with the object lo_window also mention this object in attribute and make it public and use below methods to display this window as popup and close this popup whereever you required like in view ...etc

    lo_window->open( ).

    lo_window->close( ).

    Thanks,

    Mukesh

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 31, 2013 at 07:52 AM

    Hi Vikram , don't use init method for popup but use modify method.

    Add comment
    10|10000 characters needed characters exceeded