0

I'm developing an app with a login and I need use an autocomplete input. In HTML is easy to develop it, but I don't know how to implement.

I find a solution where set data to the input, but in my case, I can't do it.

Example:

First Time: Log with the name: "Name1" Second Time: Log with the name: "Name2" Third Time: When the user write "N", the input must show "Name1", "Name2"

Thanks!

Pablo Garcia
  • 361
  • 6
  • 23
  • 1
    Possible duplicate of [How to add browser cache autocomplete in SAPUI5 Input field?](http://stackoverflow.com/questions/42778647/how-to-add-browser-cache-autocomplete-in-sapui5-input-field) – Serban Petrescu Mar 27 '17 at 19:04

1 Answers1

2

Please use sap.m.Input and set it's property showSuggestion to true, also bind suggestionItems as in this example.

Jaro
  • 1,757
  • 1
  • 15
  • 36
  • But the problem is that I don't have model to bind. If the user write "example" the next time this user start to write "ex.." the input need to show "example" as a suggestion – Pablo Garcia Mar 27 '17 at 13:08
  • Create model, bind it to sap.m.Input and then when user writes "example" save it to the model and next time when one writes "e" "example" will be suggested. – Jaro Mar 27 '17 at 13:22
  • But when the user restart the app, this model will be lost – Pablo Garcia Mar 27 '17 at 13:28
  • You can save it to hdd. – Jaro Mar 27 '17 at 13:30
  • There is no way to do like html5? just indicate to the input "Autocomplete" – Pablo Garcia Mar 27 '17 at 15:48
  • Sorry, I do not know html5, what do you mean? – Jaro Mar 27 '17 at 19:53
  • 1
    In HTML if you set the attribute "autocomplete" = "on" this proccess is automatical – Pablo Garcia Mar 28 '17 at 11:49
  • @PabloGarcia hello from the future. Did you able to solve problem with native html5 attributes. I don't want to use, suggestionItems or sapui5 suggestion system. autcomplete=off is disabled by default, do you have any solution for this problem – ExDet May 22 '23 at 17:42