on 09-09-2014 10:40 AM
Hi gurus,
Does anybody knows if is there a way to handler or execute a code when I press the close button (X) in a popup BSP window.
I have a popup which is created in a BSP extension.
My popup is created
The thing is I put a external break in the event EH_ONPOPUP , but is not been raised.
Any help is useful.
Thanks in advance.
Regards
I mean, my requirement is avoid the user could close the popup. Do you know if is this possible ?
Thanks in advance.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diego,
Little confusion with the above statement, Here i am summerising your requirement.
You have added a button when user clicks on it, system will raise a popup you want to add code on close event of the popup, is my understanding correct with your requirement?
Create close event in the same view where you have added button to open popup, if you have already created event then check in do_handle_event of the same view and check whether popup close event is triggering.
Best Regards,
Dharmakasi.
Hi,
Create the POPUP event in the first view (from which view popup is raised same view you need to created popup close event ).
means from view1 you are calling view2 as popup you need to create event in view1 for close event.
If you want close the popup using button from popup then you need to create outbound plug in window of the popup view and call that outbound plug in the event of the button.
DATA:lr_window TYPE REF TO ZL_class."class of window
lr_window ?= me->view_manager->get_window_controller( ).
lr_window->call_outbound_plug( iv_outbound_plug = 'CANCEL' ).
Create cancel outbound plug in window
call statndard cancel method
METHOD op_cancel.
fire_outbound_plug( 'CANCEL' ).
ENDMETHOD.
Regards,
Deepika.
Hi Diego,
Even if you click the X icon system will trigger the assigned close event.
Are you providing any buttons in popup? If there are buttons you can differentiate the button clikc on the X icon click by using the simple outbound plug name from the window.
Other option if you are receiving any collection from the popup then you add a check for the collection bound, In case of button click system will get collection and if it is X icon click system will not have any collection.
Best Regards,
Dharmakasi.
Hi,
You shall use the below sample code.
CALL METHOD comp_controller->window_manager->create_popup_2_confirm
EXPORTING
iv_title = <Popup Title>
iv_text = <Popup Text>
iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_yesno " Yes or No button combination in Popup.
RECEIVING
rv_result = gr_confirm_popup.
gr_confirm_popup->set_on_close_event( iv_event_name = 'CONFIRM_POPUP_CLOSED'
iv_view = me ).
gr_confirm_popup->open( ).
Create an event handler for the event "CONFIRM_POPUP_CLOSED".
METHOD eh_onconfirm_popup_closed.
IF gr_confirm_popup IS BOUND.
lv_flag = gr_confirm_popup->get_fired_outbound_plug( ).
IF lv_flag = 'Y'.
" Yes
ELSE lv_flag = 'N'.
" No
ELSE.
" X Button pressed
ENDIF.
ENDIF.
ENDIF.
IF lv_flag = 'Y' or 'N' or ' '.
" Implement your logic
ENDIF.
ENDMETHOD.
Regards,
Karthi M R.
Hi Diego,
Please insert peace of code below of yours.
dec_popup->set_on_close_event( iv_event_name = 'text_close' iv_view = me ).
Thanks and Regards,
Santosh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the name used to create the event, its casesitive. Name you mentioned in on_close_event and the event you created both should have same name with case sensitive.
Best Regards,
Dharmakasi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Put a break point in DO_HANDLE_EVENT and check which event is called when you close the popup.
POPUP event should be created in the view from where you are calling the popup not in the popup view.
Regards,
Deepika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.