[codenameone-discussions] Re: Slow results with dynamic AutoCompleteTextField

2018-02-14 Thread Shai Almog
Hi, the timer variable should be a member of the class not a variable within the body. That way you can check and cancel... Something like this will be closer to what you need: UITimer timer; protected boolean filter(String text) { if (text.length() == 0) { if(timer != null) timer.c

[codenameone-discussions] Re: Slow results with dynamic AutoCompleteTextField

2018-02-14 Thread rdvg1962
Hello, I have tried several options but I only get error messages, I appreciate the support on how to insert the UITimer API. My code: final DefaultListModel lmArticulos = new DefaultListModel<>(); AutoCompleteTextField atArticulo = new AutoCompleteTextField(lmArticulos) {

[codenameone-discussions] Re: Slow results with dynamic AutoCompleteTextField

2018-02-13 Thread Shai Almog
Hi, sure. I demonstrated this in the online courses but this is a pretty simple strategy. Keep a variable called timer of type UI timer and whenever you get an event: - If you have a timer just cancel it - Create a new timer to send the event in 500ms or even 1 second. That way you create a del