AutoCompleteTextField and the selected value

33 views
Skip to first unread message

romanca...@gmail.com

unread,
Aug 7, 2016, 11:47:07 PM8/7/16
to CodenameOne Discussions
HI! im tryng to implement the autocompletetextfield to search in google and after look for the lat/long of the address.


as i understand i add a ListListener to call the service in google who returns the lat/lng for the address auto completed.

my problem is that when i see the textbox's value it didnt return the "autocompleted" it just returns the typed for me.

how i can execute the original Listener and after the one i created?

my code is:

                textSearchGoogle.addListListener((l) ->
                {


                            ConnectionRequest conn = new ConnectionRequest()
                            {
                                @Override
                                protected void readResponse(InputStream input) throws IOException
                                {
                                    InputStreamReader reader = new InputStreamReader(input);
                                    JSONParser parser = new JSONParser();
                                    Hashtable response = parser.parse(reader);

                                }

                            };
                            conn.setPost(false);
                            conn.setUrl("https://maps.googleapis.com/maps/api/geocode/json");
                            conn.addArgument("address", textSearchGoogle.getText());
                            conn.addArgument("key", apiKey);
                            NetworkManager.getInstance().addToQueueAndWait(conn);
                });

thank you!


If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device

Shai Almog

unread,
Aug 8, 2016, 12:19:24 AM8/8/16
to CodenameOne Discussions, romanca...@gmail.com

romanca...@gmail.com

unread,
Aug 8, 2016, 7:47:57 AM8/8/16
to CodenameOne Discussions, romanca...@gmail.com
yes! i took the code from there

Shai Almog

unread,
Aug 9, 2016, 12:56:46 AM8/9/16
to CodenameOne Discussions, romanca...@gmail.com
It doesn't look like that code at all. Notice we overrode the filter and you are using a listener.
Reply all
Reply to author
Forward
0 new messages