Skip to Content
avatar image
Former Member

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

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?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Mar 24, 2017 at 12:33 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 24, 2017 at 08:51 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 26, 2018 at 09:46 AM

    Hi,

    >> In combobox manual option is given for suggestions. If user entered a text which does not match DD value, the key will be set to "" (empty).

    >> We can validate this key and value in change event of combobox.

    >> In Multicombo we have option to select multiple and the selected values are converting into Tokens "value (key)", this is the reason why it is not allowing to enter wrong values. But for Combobox we have to put a manual validation.

    Regards,

    Gururaj

    Add comment
    10|10000 characters needed characters exceeded