on 10-10-2009 8:05 AM
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
hi,
You can use OnEnter event of Input field and check for number of characters entered in input field and throw error message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.