Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in AutoComplete #243

Open
vipul-mykaarma opened this issue Feb 25, 2020 · 0 comments
Open

Error in AutoComplete #243

vipul-mykaarma opened this issue Feb 25, 2020 · 0 comments

Comments

@vipul-mykaarma
Copy link

vipul-mykaarma commented Feb 25, 2020

Hi all,
I am getting the error

places_impl.js:30 Uncaught TypeError: Cannot read property 'trim' of undefined
at V9 (places_impl.js:30)
at O9._.r.vm (places_impl.js:61)

`

	AutocompleteType[] types = new AutocompleteType[1];
	types[0] = AutocompleteType.LOCALITY;
	AutocompleteOptions options = AutocompleteOptions.newInstance();
    options.setTypes(types);
	final Autocomplete autoComplete = Autocomplete.newInstance(
			tb.getElement(), options);
	
	 autoComplete.addPlaceChangeHandler(new PlaceChangeMapHandler() {
            public void onEvent(PlaceChangeMapEvent event) {
                PlaceResult result = autoComplete.getPlace();
                
                //result.getGeometry().getLocation().ge
                tb.setValue(result.getName());
            }
        });
	 
	 tb.addKeyDownHandler(new KeyDownHandler() {           
            @Override
            public void onKeyDown(KeyDownEvent event) {             
                if(event.getNativeKeyCode() == KeyCodes.KEY_ENTER){
                    GWT.log("Blocking form submit for autocomplete text box");
                    event.preventDefault();
                }
            }
        });`
@vipul-mykaarma vipul-mykaarma changed the title Module not loading Error in AutoComplete Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant