on 03-31-2011 12:29 PM
Hello Experts,
We have a requierment to display a pop up window with some text(terms and conditions of use) with a check box (I Accept).
How can I enable disable the OK button in pop up window based on the check box.
If the cbox is checked--> enable the OK button else disable it.
I searched the forum and found the thread
[Making the button disabled in the pop up window|]
but could not understand the complete steps.
Can some one please explain how to achieve this ?
Thanks,
Anubhav
>
> Hello Experts,
>
> We have a requierment to display a pop up window with some text(terms and conditions of use) with a check box (I Accept).
> How can I enable disable the OK button in pop up window based on the check box.
> If the cbox is checked--> enable the OK button else disable it.
>
> I searched the forum and found the thread
> [Making the button disabled in the pop up window|]
>
> but could not understand the complete steps.
>
> Can some one please explain how to achieve this ?
>
> Thanks,
> Anubhav
It is simple if its your custom popup window.
You have a context attribute of type wdy_boolean binded to checked property of the checkbox.
Bind the same attribute for the OK button enabled property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Baskaran,
I am using below code
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
DATA lo_window TYPE REF TO if_wd_window.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->create_window(
window_name = 'W_POPUP'
title = 'Terms And Conditions'
* 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_ok
message_type = if_wd_window=>co_msg_type_none
default_button = if_wd_window=>co_button_ok
).
lo_window->open( ).
To open the pop up window in method WDDOINIT of my MAIN view to show the pop up before the main application is displayed.
How to bind the ENABLED property of OK button in this case ?
Thanks,
Anubhav
enable this line in your code.
button_kind = if_wd_window=>co_buttons_ok
in the component controller save the lo_window instance as public attribute so that you can access this later from the popup view.
in the popup view, wddomodifyview method check if the checkbox is checked based on that call the set_button_enabled method.
if first_time = abap_true.
wd_comp_controller->lo_window->set_button_enabled( abap_false ).
endif.
Edited by: Baskaran Senthivel on Mar 31, 2011 2:07 PM
Hi,
Create button in view, create action as OK.
Create one attribute on type wdy_boolean, bind to button enable property.
In OK button On_action write code..
Read checkbox value here.. if it is checked for example..
if lv_check = 'X'.
get single attribute
lo_el_context->set_attribute(
EXPORTING
name = `ENABLE`
value = abap_true ).
else.
get single attribute
lo_el_context->set_attribute(
EXPORTING
name = `ENABLE`
value = abap_false ).
endif.
Cheers,
Kris.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.