branflake2267 / GWT-Maps-V3-Api

GWT Maps V3 Javascript Bindings
Other
144 stars 113 forks source link

Autocomplete error #192

Open leokury opened 11 years ago

leokury commented 11 years ago

When I put just a input with a autocomplete instance associated I got a error like "Cannot read property 'maps' of undefined". It is not possible to have just a input with autocomplete without a map object?

Source code: final TextBox t = new TextBox(); AutocompleteType[] types = new AutocompleteType[1]; types[0] = AutocompleteType.LOCALITY;

        AutocompleteOptions options = AutocompleteOptions.newInstance();
        options.setTypes(types);

        final Autocomplete autoComplete = Autocomplete.newInstance(
                t.getElement(), options);

        autoComplete.addPlaceChangeHandler(new PlaceChangeMapHandler() {
            public void onEvent(PlaceChangeMapEvent event) {
                PlaceResult result = autoComplete.getPlace();
                t.setValue(result.getName());
            }
        });

Complete error stack: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.google.gwt.maps.client.placeslib.Autocomplete::createJso(Lcom/google/gwt/dom/client/Element;Lcom/google/gwt/maps/client/placeslib/AutocompleteOptions;)([JavaScript object(128), JavaScript object(129)]): Cannot read property 'maps' of undefined at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.maps.client.placeslib.Autocomplete$.createJso(Autocomplete.java) at com.google.gwt.maps.client.placeslib.Autocomplete$.newInstance(Autocomplete.java:56) at br.com.minhabio.client.ui.base.SaveTextbox.(SaveTextbox.java:102) at br.com.minhabio.client.ui.EditableField.(EditableField.java:70) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl$Widgets.build_cidade(CurriculoEditor_CurriculoEditorUiBinderImpl.java:174) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl$Widgets.get_cidade(CurriculoEditor_CurriculoEditorUiBinderImpl.java:170) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl$Widgets.build_f_Fieldset2(CurriculoEditor_CurriculoEditorUiBinderImpl.java:105) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl$Widgets.get_f_Fieldset2(CurriculoEditor_CurriculoEditorUiBinderImpl.java:96) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl$Widgets.build_f_Form1(CurriculoEditor_CurriculoEditorUiBinderImpl.java:85) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl$Widgets.get_f_Form1(CurriculoEditor_CurriculoEditorUiBinderImpl.java:79) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl$Widgets.access$1(CurriculoEditor_CurriculoEditorUiBinderImpl.java:78) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl.createAndBindUi(CurriculoEditor_CurriculoEditorUiBinderImpl.java:30) at br.com.minhabio.client.editor.CurriculoEditor_CurriculoEditorUiBinderImpl.createAndBindUi(CurriculoEditor_CurriculoEditorUiBinderImpl.java:1) at br.com.minhabio.client.editor.CurriculoEditor.(CurriculoEditor.java:57) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:475) at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) at com.google.gwt.core.shared.GWT.create(GWT.java:57) at com.google.gwt.core.client.GWT.create(GWT.java:85) at br.com.minhabio.client.view.CurriculoView_CurriculoViewUiBinderImpl$Widgets.build_curriculoEditor(CurriculoView_CurriculoViewUiBinderImpl.java:53) at br.com.minhabio.client.view.CurriculoView_CurriculoViewUiBinderImpl$Widgets.get_curriculoEditor(CurriculoView_CurriculoViewUiBinderImpl.java:49) at br.com.minhabio.client.view.CurriculoView_CurriculoViewUiBinderImpl$Widgets.access$0(CurriculoView_CurriculoViewUiBinderImpl.java:48) at br.com.minhabio.client.view.CurriculoView_CurriculoViewUiBinderImpl.createAndBindUi(CurriculoView_CurriculoViewUiBinderImpl.java:15) at br.com.minhabio.client.view.CurriculoView_CurriculoViewUiBinderImpl.createAndBindUi(CurriculoView_CurriculoViewUiBinderImpl.java:1) at br.com.minhabio.client.view.CurriculoView.(CurriculoView.java:27) at br.com.minhabio.client.MinhaBio.onModuleLoad(MinhaBio.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:406) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) at java.lang.Thread.run(Unknown Source)