Help with autocompletetextfield component

10 views
Skip to first unread message

rdvg...@gmail.com

unread,
Feb 25, 2018, 4:03:05 PM2/25/18
to CodenameOne Discussions
Hi,

Load the component with the names of 100 articles that come from a database. Unfortunately there are names that repeat themselves.

I create a method that validates by the name selected in the autocompletetextfield and looks for the complete record of the database. When selecting one of the repeated names my method always brings me the first record.
Is there any way to differentiate records with duplicate names in the autocompletetextfield component? For example: that you return the registration number within the "ListModel".

Thanks

Shai Almog

unread,
Feb 25, 2018, 10:54:59 PM2/25/18
to CodenameOne Discussions
Hi,
I don't think it has as much to do with the auto-complete as it has to do with the model. If you just want the unique name you can use the unique SQL keyword to narrow your search.
Every entry within the auto-complete can be mapped to additional meta-data and rendered with more than the String e.g. https://www.codenameone.com/blog/tip-auto-complete-renderer.html
Reply all
Reply to author
Forward
0 new messages