cancel
Showing results for 
Search instead for 
Did you mean: 

Disabled the txt field that corresponds to an object cl_crm_bol in run time

Former Member
0 Kudos

Hello experts,

I have the content of my object, but I would like to disabled the txt field that corresponds to this field by code.

sSectorPod = lr_entityPoint->IF_BOL_BO_PROPERTY_ACCESS~GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PD_SPARTE' ).

Disabled the txt field that corresponds to 'PD_SPARTE' attribute by code with a method, Could you help me please???

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member813607
Contributor
0 Kudos

Dear Garcia,

For disabling a field you have to make the attribute 'disabled' = TRUE in the .htm page of the view, you can find the attribute 'disabled' under the corresponding input field tag.

But In your case you want that to be a variable as it should act as a disabled field according to the value it contains. so you make a page/layout variable of type boolean and pass the value to it accordingly from the controller..

Regards, Sudeep..

Former Member
0 Kudos

Thanks for your answer, and thanks for you time, Please, could you detail a little more this

"+ so you make a page/layout variable of type boolean and pass the value to it accordingly from the controller..+"

Thanks a lot,

Regards,

Garcia the climber

former_member813607
Contributor
0 Kudos

Hi Garcia,

I dont have access to the server right now, hence I cant paste a sample code now!. but I can elaborate what i meant..

page layout or page variables you can find them in the page attributes tab of .htm page, where you have to create a new variable of type CRMT_BOOLEAN, say lv_bool.

now, open the layout tab and modify the attribute of input field as disabled = <%= lv_bool %>

thats all at the .htm page, now come to your controller ( *_IMPL class ) I assume that you have aready made it in customer namespace ( z ) so that we can modify. here you have to check the value of the variable ( via getter method ) and under the condition you have to set the variable lv_bool to TRUE / FALSE. a sample code you can see from the set_models( ) method of the controler, please go through it.

hope it helps..

Regards, Sudeep..

Former Member
0 Kudos

A lot of thanks, Sudeep,

And other little question is there an option to detect when a user is typing in a textfield???

Thanks for your help in my life,

The climber

Answers (0)