cancel
Showing results for 
Search instead for 
Did you mean: 

Restricting max lenfth in Input field

Former Member
0 Kudos

Hi,

I have use BW standard Object and this is binded to my Input field. Since BW Object is of length 60, Input field in Web Dynpro is allowing me to enter 60 Character. I want to restrict the input field to 40 so that user can not enter more than 40 character.

Is there any possiblity to restrict input field without changing binding elemnt.

Thanks

Abhishek

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

You can use OnEnter event of Input field and check for number of characters entered in input field and throw error message.

Former Member
0 Kudos

Yes,I was doing the same. But that is not acceptable as per the user requirement and User isnot aggreeing on that.

I need to restrict the input field while entering i.e any property available for the input field.

Former Member
0 Kudos

Other option is restrict the no of characters entered by user by binding it with context attribute of char40.

OR

you could even avoid the OnEnter event of Input field if you have some more UI fields in your layout i.e.

If you have a dropdown or a button to naviagate to other screen, then you could check there also.

If there is no other UI, Try writing the code in wddomodify, but please be aware that wddomodify is called on evry event.

So if you are writing code to restrict no of characters to 40 in wddomodify, write it with a conditon like :

if lv_input is not initial.

< check the no of char and throw erro.>

endif.

lv_input has the value of input field which you could read by code wizard i.e control + F7.

Former Member
0 Kudos

Other option is restrict the no of characters entered by user by binding it with context attribute of char40.

OR

you could even avoid the OnEnter event of Input field if you have some more UI fields in your layout i.e.

If you have a dropdown or a button to naviagate to other screen, then you could check there also.

If there is no other UI, Try writing the code in wddomodify, but please be aware that wddomodify is called on evry event.

So if you are writing code to restrict no of characters to 40 in wddomodify, write it with a conditon like :

if lv_input is not initial.

< check the no of char and throw erro.>

endif.

lv_input has the value of input field which you could read by code wizard i.e control + F7.