on 01-29-2008 8:28 AM
Hi,
How can i disable button when i click on that button. That means first time it should be enable. When i click on that button it should be disable. How can i do that one.. help me
Hi Shyja ,
First we should create attribute(ENABLE) with data type as WDY_BOOLEAN , then bind that attribute to button's Enable property,After that go to WDDOINIT() method in View , Write the following code,
DATA:
elem_context TYPE REF TO if_wd_context_element,
stru_context TYPE if_v_main=>element_context ,
item_enable LIKE stru_context-enable.
get element via lead selection
elem_context = wd_context->get_element( ).
get single attribute
elem_context->get_attribute(
EXPORTING
name = `ENABLE`
IMPORTING
value = item_enable ).
CALL METHOD elem_context->set_attribute
EXPORTING
VALUE = 'X'
name = `ENABLE` " Attribute Name
.
After that we should create one event for that button ,
then we should write below code for that event method,
DATA:
elem_context TYPE REF TO if_wd_context_element,
stru_context TYPE if_v_main=>element_context ,
item_enable LIKE stru_context-enable.
get element via lead selection
elem_context = wd_context->get_element( ).
get single attribute
elem_context->get_attribute(
EXPORTING
name = `ENABLE`
IMPORTING
value = item_enable ).
CALL METHOD elem_context->set_attribute
EXPORTING
VALUE = ' '
name = `ENABLE` " Attribute Name
.
Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
In WDDOMODIFY view
try the following:
DATA : obj_btn TYPE REF TO cl_wd_button.
obj_btn ?= view->get_element( 'button' ).
if ( first_time == abap_false ).
CALL METHOD obj_btn->set_enabled(
EXPORTING
value = abap_false ).
endif.
Thanks,
madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shyja,
could you please stop reposting your question? It is already answered in each of your 3 threads.
Thank you,
Sascha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.