cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable INPUT field in Webdynpro Abap based on some Action.?

Former Member
0 Kudos
3,542

I have a Webdynpro screen, where all INPUT fields are displayed in Enabled mode. Based on the user Action condition, some of the INPUT fields needs to be DISABLED (Not Invisible). How to achieve it?

Thanks,

Padma

Edited by: Padmashree RamMaghenthar on Sep 10, 2009 6:29 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

create a context attribute of type wdy_boolean. now bind the visibility property of the input field with this attribute.

wherever you want to make it disabled just set the attribute value as ' '. it will diable i.e make your input field invisible.

regards,

anand

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks. Thread Closed.

Former Member
0 Kudos

1. Create a context attribute of type wdy_boolean with the name say "Field_enable"

2. Bind this attribute to the input field's property "enabled" in the view.

3. initialize this variable to abap_true in the wddoinit of the controller or view with the following code

DATA lo_el_context TYPE REF TO if_wd_context_element.

DATA ls_context TYPE wd_this->element_context.

DATA lv_field_enable TYPE wd_this->element_context-field_enable.

  • get element via lead selection

lo_el_context = wd_context->get_element( ).

  • fill attribute

lv_field_enable = abap_true.

  • set single attribute

lo_el_context->set_attribute(

name = `FIELD_ENABLE`

value = lv_field_enable ).

4. select the action on which you need to disable the fields and write the following code

  • get element via lead selection

lo_el_context = wd_context->get_element( ).

  • fill attribute

lv_field_enable = abap_false.

  • set single attribute

lo_el_context->set_attribute(

name = `FIELD_ENABLE`

value = lv_field_enable ).

5. If you want to make it invisible or visible use the above method with the view element property visible instead of "enabled"

Former Member
0 Kudos

Hi,

Bind the enable property of the Input field to the Attribute of type Boolean.

Now when u want the input field enable then set the attribute's value as 'X'.

otherwise set its value as ' '.

Regards,

Pankaj Aggarwal

former_member40425
Contributor
0 Kudos

Hi,

Create a context attribute of type WDY_Boolean and bind it with the read only property of your input field. When You want to disable it, Set this attribute as true.

I Hope it helps.

Regards,

Rohit