Textfield that shows previous 5 entries

I want to have a TextField to show the previous 5 entries that was entered in that field, so that it can assist the user to remember and enter back the previous entry (e.g. Account Number). Is there a way to do this using TextField ?

I have also tried using SuggestionField but it does not allow me to enter a NEW value.

The “remembered” list should only persist in User Session. Once the user logs out, the list is wiped out.


Unfortunately, there is no component that fully meets your needs, but in case of SuggestionField, you can add the EnterActionHandler and set searchString as a value imitating the user input functionality in addition to showing suggestions, e.g.:

suggestionField.setEnterActionHandler(searchString -> {