cancel
Showing results for 
Search instead for 
Did you mean: 

TextEdit lock for entries

Former Member
0 Kudos


Hello Expert's

I want to lock my Text edit if a specified event occurs.

the user should be unable to change the filled text.

otherwise he should be able to change the text.

Thank you for any hint

Best regards

Annette Bruy

Accepted Solutions (1)

Accepted Solutions (1)

harsha_jalakam
Active Contributor
0 Kudos

Hi Annette,

We can disable the text edit by using the read only property of the UI.

1. Create a attribute of WDY_BOOLEAN, and bind it to the read only propert of Text Edit UI.

2. Based on you requirement for the specified event , set the value of this attribute to 'X' in the event           handler method, so that the UI is locked for editting.

Regards,

Harsha

Former Member
0 Kudos

Hello Harsha,

I also had the same idea but it doesn't work

wd_context->set_attribute( exporting name = 'READONLY_TEXT'

                                                      value = abap_false ).

Binding in visible:

BANF.READONLY_TEXT:READ_ONLY

What is wrong?

Best´regards

Annette Bruy

harsha_jalakam
Active Contributor
0 Kudos

Hi Annette,

If you want to disable the textedit from editting,i.e, locking the value must be abap_true('X').

I guess you have given ABAP_FALSE, hence it is still in Edit mode, even after the even handler is triggered.

Regards,

Harsha

Former Member
0 Kudos

Hi Harsha

it works

but the text edit disappers!!!!!!

What can I do that the user could see the text?

Thank for your hints

Best regards

Annette Bruy

former_member184578
Active Contributor
0 Kudos

Hi,

You have to bind the Read Only property instead of Visible property.

Regards,

Kiran

harsha_jalakam
Active Contributor
0 Kudos

Seems like you have binded the attribute to Visible property , bind it to the readOnly Property.

Former Member
0 Kudos

Hi

But with this bindings the Text_edit disappiers! I think i become stupid

Why ?

Best regards

Annette


harsha_jalakam
Active Contributor
0 Kudos

Hi Annette,

You need to bind the attribute to the read only property, not to the visible property as shown in the figure.

Regards,

Harsha

ramakrishnappa
Active Contributor
0 Kudos

Hi Annette,

You have bound the READ_TEXT to the visible property instead you need to bind it to the READ ONLY property

Note:

when you set READ_TEXT = ABAP_TRUE ------> The text edit field will not locked for editing ( READ ONLY )

and if you set READ_TEXT = ABAP_FALSE ------> The text edit field will be open for editing

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Oh no!

I was very stupid

Thank you!

You're right!

I'm just a beginner in Web Dynpro


Answers (1)

Answers (1)

Former Member
0 Kudos


Hi Annette,

Once the event is occuered, set a flag = 'X' as an ATTRIBUTE in component controller.

And then in the WDMODIFYVIEW you can write the condition for making the TEXT-EDIT non-editable/editable based on the the above attribute flag.

Hope it would help.

Thanks,