Skip to Content
avatar image
Former Member

SET_ON_CLOSE_ACTION ( view = ?

hello webdynpro experts,

I'm new to webdynpro.

I have created a method in the component controller called OPEN_POPUP :

data:

lr_api_comp_controller type ref to if_wd_component,

lr_window_manager type ref to if_wd_window_manager,

lr_api_comp_controller = wd_this->wd_get_api( ).

lr_window_manager = lr_api_comp_controller->get_window_manager( ).

e_popup = lr_window_manager->create_window(

window_name = i_popup_name

BUTTON_KIND = i_button_kind

MESSAGE_TYPE = i_message_type

).

e_popup->open( ).

This is successful in the way that I can close the button. But how can I catch the event Close of the pop-up ?

I have tried to use the SET_ON_CLOSE_ACTION but I do not know what to put in the view parameter ?

Please note that I call this method from within another method in the same controller :

wd_this->open_popup(

i_popup_name = 'WND_PROCESS_DATE'

i_button_kind = if_wd_window=>co_buttons_close

i_message_type = if_wd_window=>CO_MSG_TYPE_QUESTION ).

where you can see that the pop-up has its own window but also its own view.

Please advise,

Thank you.

cheers,Zied.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jul 04, 2007 at 12:47 PM

    Hi Zied,

    you need to pass the reference of the view in which action handler for the "CLOSE" exists.

    for example,

    if you are calling window "W1" which contains "V1", then you should create an action( under the actions tab of view V1 ) say "CLOSE", you can put the appropriate handling code here.

    now within the method set_on_close_action you need to pass the reference to the above view and the above action name.

    wd_get_api( ) can be used to get the reference to the view.

    Regards,

    Shweta

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 04, 2007 at 12:42 PM

    Hi

    You could get the view instance from the view and save it the coponent controller instance.then use it for set_on_close.

    lo_api TYPE REF TO if_wd_view_controller.

    lo_api = wd_this->wd_get_api( ).

    This method in teh view will give back the view controller...save it in the cmponet controller....

    Thanks

    Anzy

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hello Mohammed,

      thanks for your reply.

      I have unfortunately tried this option, but I got a Type conversion problem. Indeed you can see in the code snippet above that the type returned by wd_this->wd_get_api( ) is if_wd_component and not if_wd_view_controller which is the one needed for the View parameter of the method SET_ON_CLOSE_ACTION .

      I did a cast as well but I got a runtime error 😔

      Are there other options ?

      cheers,Zied.

  • avatar image
    Former Member
    Jul 04, 2007 at 02:25 PM

    good job Mohammed !

    Add comment
    10|10000 characters needed characters exceeded