on 05-28-2013 2:05 PM
Hi all gurus,
pretty dumb question, but it's driving me mad 😕
I create a popup in the following way:
lo_window = lo_window_manager->create_window(
window_name = 'CONDITIONS_POPUP'
title = lv_title
* close_in_any_case = abap_true
message_display_mode = if_wd_window=>co_msg_display_mode_selected
close_button = abap_false
button_kind = if_wd_window=>CO_BUTTONS_OKCANCEL
message_type = if_wd_window=>co_msg_type_none
default_button = if_wd_window=>co_button_ok
).
Notice that I need basically two buttons; one to confirm, and the other one to cancel.
After that, I bind both buttons to the corresponding actions (in the meantime, I also change their labels):
*Subscribe to event OK
lo_window->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
BUTTON_TEXT = 'I agree'
action_name = 'CONFIRM_OK'
action_view = L_RUNTIMEAPI
).
*Subscribe to event Cancel
lo_window->subscribe_to_button_event(
button = if_wd_window=>co_button_cancel
BUTTON_TEXT = 'I disagree'
action_name = 'CONFIRM_CANCEL'
action_view = l_runtimeapi
).
Now... the task is simple: I have to enable/disable dynamically the OK button. In order to do so, I have to get a reference to that WD UI element in WDDOMODIFYVIEW so that I can easily adjust the ENABLED property. The odd fact is that I cannot find that element in debug navigating thru the VIEW object... and I need an ID to use the VIEW's GET_ELEMENT method.
Could anyone help me with this - apparently - simple task? Any help will be appreciated .
Hi Matteo.
If you want to enable or disable the POPUP buttons you can use SET_BUTTON_ENABLED method of IF_WD_WINDOW.
There are two parameters one of type WDR_POPUP_BUTTON and another is boolean to set the button enabled. By default all the popup buttons are enabled. So you can call something like:
lo_window->set_button_enabled(
button = if_wd_window=>co_button_ok
is_enabled = abap_false ). " To disable the okay button
Hope it helps.
Regards
Abhinav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
As Abhinav said you can use the above code.
If you want the refernce global please declare a attribute at component controller level and pass the reference of lo_window post create_window method.
With the reference you can play with the enabling and disabling.
eg:
global_reference ?= lo_window.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.