cancel
Showing results for 
Search instead for 
Did you mean: 

Disable input Field in WDDOINIT

antonio_sanseverino
Participant
0 Kudos

Hi

I've this question, during a loading of web dynpro I need to disable an input field for a particular kind of users, how can I disable an input field in WDDOINIT method?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

antonio_sanseverino
Participant
0 Kudos

Hi I've done by myself, it's possible to do it into WDINIT method using an attribute to fill that is used to bind the input filed enable property.

It's possible to disable/enable the field into WDDOMODIFYVIEW with attribute 'FIRST' = X and using class CL_WD_INPUT_FIELD

l_input type ref to cl_wd_input_field.

l_input ?= view->get_element( 'COUNTRY' ).

l_input->set_read_only( abap_true ).

I'll mark this as correct answer if nobody will reply in 5 days

Gowtham
Contributor
0 Kudos

Hi Antonio,

It is better to go ahead with WDINIT method because WDDOMODIFYVIEW method will called after each & every action/event trigger.

- Gowtham

antonio_sanseverino
Participant
0 Kudos

Yes

The first method I've mentioned and honestly that I've used for my web dynpro, with a boolean attribute that is valorised with TRUE or FALSE linked to property "enable" of the input object

The method WDDOMODIFYVIEW has the attribute FIRST that is valorised ad X the first time is called when you open the web dynpro.


Thank you

Former Member
0 Kudos

Hi,

Either you can set the attribute value in WDDOMODIFYVIEW( ) (With condition FIRST_TIME = X) or WDDOINIT( ).

But the best practice is to write the code in  WDDOINIT( ) as you are just setting the variable value to true/false.WDDOMODIFYVIEW( ) will be triggered on every action of that particular view even though you set FIRST_TIME value.

Thanks

KH

Answers (0)