Skip to Content
0

How do i restrict the user input in ComboBox to only model data in SAPUI5?

Mar 24, 2017 at 04:09 AM

83

avatar image

I have a scenario where i want to restrict user to only input text that is only loaded to the combobox as seen in this MultiComboBox example. [Take note that this is not my jsbin. please post your answer in this thread]

http://jsbin.com/sicixisozi/edit?html,js,output

in the above example, user is only allowed to enter characters that are present in the combobox, for example entering a 's' will prompt invalid entry and prevent user from typing. however i do not need the multi select as i only allow one selection.

this function is not found in default SAPUI5 combobox

http://jsbin.com/xenidoh/embed?html,output

as seen in above example, user are not restricted and are able to input anything to the combobox.

any suggestion how i could implement the feature above?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Jun Wu Mar 24, 2017 at 12:33 PM
1
Show 1 Share
10 |10000 characters needed characters left characters exceeded

dropdown would be the right control

0
Mahesh kumar palavalli Mar 30, 2017 at 05:36 AM
-1

you could simply use the change event and check the binded model data if the user is entering the correct value or not.

Best Regards,
Mahesh

Share
10 |10000 characters needed characters left characters exceeded
Akhilesh Upadhyay Mar 24, 2017 at 08:51 AM
0

not sure about any inbuilt functionality for that, but you can try below.

you can attach browser event for "keyup", check this Example may help you.

Share
10 |10000 characters needed characters left characters exceeded