cancel
Showing results for 
Search instead for 
Did you mean: 

Subscribing to a Close Event from apopup window

IanStubbings
Active Participant
0 Kudos

Hi

I have copied a std sap WDA called HRRCF_C_POSITION which call s a popup window. In the std sap component, there is no subscription to the close event of the popup windowand yet it appears to happen automatically. In my version of the component the auto close subscription does not work and since I am calling the popup from the component controller I do not have access to the view controller to get the api reference.

Anyone come across this before?

How do I pass in a view controller reference to the subscribe to event method from the component controller when there is none?

Cheers

Ian

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ian,

i think first of all you shul go thru the various controllers and their access and aslo various api which are being used.

for this go thru this on line help

Link: [on line help|http://help.sap.com/saphelp_nw70/helpdata/EN/61/497941761b070de10000000a1550b0/frameset.htm]

IanStubbings
Active Participant
0 Kudos

Thanks both to your help but I have solved the issue. Basically I had missed out the following code in the WDDOINIT of the view that called the popup.

  • Subscribe to the close event

DATA view_select_activity TYPE REF TO if_wd_view_controller.

view_select_activity = wd_this->wd_get_api( ).

wd_comp_controller->popup_window->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

action_name = 'CLOSE'

action_view = view_select_activity ).

Former Member
0 Kudos

hi,

I am calling the popup from the component controller I do not have access to the view controller to get the api reference.

why are u calling the pop up from component controller ?

actually view is responsible for the representation of the data in the browser.ur controller wud format the model data to be displayed in the view, and view wud shw the data

if u write ur logic in in view , u can get the api refernce as :


DATA:  l_api TYPE REF TO if_wd_view_controller.

    l_api = wd_this->wd_get_api( ).

in ur componet controller ,at runtime u also get an access to so called run time interface of type IF_WD_COMPONENT. This is a generic standard API which is provided by web dynpro framework to access some important information related to the component


data:

    l_componentcontroller_api type ref to if_wd_component.

    l_componentcontroller_api = wd_this->wd_get_api( ).

refer :

http://help.sap.com/saphelp_nw70/helpdata/EN/aa/0b8b85dce1a941b78eb3aedf47a378/frameset.htm

http://help.sap.com/saphelp_nw70/helpdata/EN/61/497941761b070de10000000a1550b0/frameset.htm

regards,

amit