AutoCompleteTextField not rendering properly?

60 views
Skip to first unread message

mikko.nu...@gmail.com

unread,
May 27, 2015, 9:03:20 AM5/27/15
to codenameone...@googlegroups.com
Hi,

I have to use AutoCompleteTextField alot because I have to add multiple personnel in many forms. However there's alot of problems with its behavior... the list of suggested items seems to appear semi-randomly depending the form. I have feeling a that it's position seems to affect this somehow, positioned at bottom of the page does not render the list even in the simulator if there is alot of components above it. Even though it does not always work as a first component either.

Is there a way to improve the operation of the list? I'm simply adding all of my components with a header label to boxlayout Y container/s and sometimes there is add button next to it.... thats it... am I missing someting?

Maaike

unread,
May 27, 2015, 10:13:04 AM5/27/15
to codenameone...@googlegroups.com, mikko.nu...@gmail.com
I have much time spended on the AutoCompleteTextField now. Actually, I think I will try to find another way to show a list when typing in a textfield. AutoCompleteTextField is very very buggy. Popup is sometimes showing, sometimes not, sometimes it's not showing but it's selecting a listitem, sometimes it's impossible to scroll, sometimes list is showing on top, later on the bottom, the app hangs sometimes when using the AutoCompleteTextField. iOS is behaving the worst in my case.

So if you find another good way to do the same, but without this AutoCompleteTextField, please let me know.

Shai Almog

unread,
May 27, 2015, 10:37:01 AM5/27/15
to codenameone...@googlegroups.com, iola...@gmail.com, mikko.nu...@gmail.com
If you can create a test case reproducing said behavior in the simulator and file an issue we can try to address that.

Maaike

unread,
May 27, 2015, 1:25:33 PM5/27/15
to codenameone...@googlegroups.com, iola...@gmail.com, mikko.nu...@gmail.com
I'm sorry I'm breaking in this topic. So topicstarter, please try to make a test case :).

In my case, it runs different on different devices. On the simulator it works mostly ok. It just needs to be better tested on devices I think.

Android: hard to click on correct item. List not always showing on same place.
iOS: sometimes when clicking in the textfield and afterwards a little above, the list did not show, but the textfield is filled with one of the list items. The list is sometimes not scrolling well. In scrollable containers, the app hangs (I already filed an issue on that).

I think the most problems are on iOS (iOS 7 & 8).

Shai Almog

unread,
May 28, 2015, 1:26:41 AM5/28/15
to codenameone...@googlegroups.com, iola...@gmail.com, iola...@gmail.com
You can file a test case for that with the explanations above, we can investigate that too.

mikko.nu...@gmail.com

unread,
May 28, 2015, 8:10:54 AM5/28/15
to codenameone...@googlegroups.com, iola...@gmail.com
I created this simple example on new project.

Simulator iOS iPhone 4&5 (for example):
It appears that the AutoCompleteTextFields at the bottom are acting more or less randomly. Usually the first one works ok (list appears), but sometimes not. Usually the one at the bottom does not work at all. If you pull the screen and pray for java gods the list appears but beyond the touchable screen. I can't believe your developers have missed this, I've had this since the beginning.

I'm really upset that the problems have been solved so slowly... my previous issues are still 'new' after about six months. This one is death-critical for my app and customers are concerned. Do I have to make this kind of feature from other components (like textbox & list)? How long does it take to fix this?

Do I have to file an issue of this or will you? Do I have to use my customer's time to make clearances like this to file these obvious issues?
 
@Override
   
protected void beforeMain(Form f) {
   
        f
.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
       
       
Label labelForFirst = new Label("first:");
       
TextField first = new TextField();
        first
.setLabelForComponent(labelForFirst);
       
       
Label labelForSecond = new Label("second:");
       
TextField second = new TextField();
        second
.setLabelForComponent(labelForSecond);
       
       
Label labelForthird = new Label("third:");
       
TextField third = new TextField();
        third
.setLabelForComponent(labelForthird);
       
       
Label labelForFourth = new Label("fourth:");
       
TextField fourth = new TextField();
        fourth
.setLabelForComponent(labelForFourth);
       
       
Label labelForFifth = new Label("fifth:");
       
TextField fifth = new TextField();
        fifth
.setLabelForComponent(labelForFifth);
       
       
Label labelForSixth = new Label("sixth:");
       
TextField sixth = new TextField();
        sixth
.setLabelForComponent(labelForSixth);    
       
        f
.addComponent(labelForFirst);
        f
.addComponent(first);
        f
.addComponent(labelForSecond);
        f
.addComponent(second);
        f
.addComponent(labelForthird);
        f
.addComponent(third);
        f
.addComponent(labelForFourth);
        f
.addComponent(fourth);
        f
.addComponent(labelForFifth);
        f
.addComponent(fifth);
        f
.addComponent(labelForSixth);
        f
.addComponent(sixth);
       
       
//////////////////////////////
       
       
Label labelForPicker = new Label("date:");
       
Picker picker = new Picker();
        picker
.setLabelForComponent(labelForPicker);
       
        f
.addComponent(labelForPicker);
        f
.addComponent(picker);
       
       
/////////////////////////////      
       
       
Contact[] contacts = Display.getInstance().getAllContacts(false, false, false, false, true, false);
       
       
//////////////////////////////
       
       
ArrayList<String> emails = new ArrayList<String>();
       
       
for (Contact contact : contacts) {
           
           
if(contact.getPrimaryEmail() != null){
                emails
.add(contact.getPrimaryEmail());
           
}
       
}
       
       
Label labelForEmails = new Label("emails:");
       
AutoCompleteTextField emailsField = new AutoCompleteTextField(emails.toArray(new String[emails.size()]));      
        emailsField
.setLabelForComponent(labelForEmails);
       
        f
.addComponent(labelForEmails);
        f
.addComponent(emailsField);
       
       
//////////////////////////////
               
       
ArrayList<String> emails2 = new ArrayList<String>();
       
       
for (Contact contact : contacts) {
           
           
if(contact.getDisplayName() != null){
                emails2
.add(contact.getDisplayName());
           
}
       
}
       
       
Label labelForEmails2 = new Label("names:");
       
AutoCompleteTextField emailsField2 = new AutoCompleteTextField(emails2.toArray(new String[emails2.size()]));      
        emailsField2
.setLabelForComponent(labelForEmails2);
       
        f
.addComponent(labelForEmails2);
        f
.addComponent(emailsField2);
   
}


Shai Almog

unread,
May 28, 2015, 10:32:39 AM5/28/15
to codenameone...@googlegroups.com, mikko.nu...@gmail.com, mikko.nu...@gmail.com, iola...@gmail.com
Please file this as an issue. Discussion forum entries get lost but issues can be tracked.
Reply all
Reply to author
Forward
0 new messages