Hi there! I have the most peculiar problem related to smartgwt, gwt and maps that i'm hoping someone can help out with.
We use maps a lot in our app, utilizing the classic Branflake maps project for GWT bindings to the JS Maps api.
In one place, we have a mapwidget with a TextBox used with Googles AutoComplete feature, which has worked fine. When user enters text, autocomplete will present some suggestions, and user can click on them. We can use that to move the map around.
Now, i tried doing a little tweak today. Basically i wanted that if the user just presses enter, we'd click on the first row in the autocomplete results and use that. The only way to do that is by catching the press event and sending a "key down" event, since there is no API access to the data. (Tons of SO threads about this)
However, i noticed, that when i press enter in the autocomplete box, the dropdown with suggestions disappear. This is strange, since it does not happen in the maps showcase.
You can test the functionality as exptected in the Branflake showcase (http://gonevertical-apis.appspot.com), scroll down to the "autocomplete" widget and notice that when you have search results, you can press enter in the text box without the results disappearing.
----
After several hours of experimenting, i have come to the following scenario:
I have a small stand-alone, runnable test project that just adds a GWT TextBox and a mapwidget to the RootPanel, which works as expected.
If i just use GWT components, i can press enter in the search box without the dropdown disappearing.
If i then just change gwt.xml to include the "SmartGwtEENoScriptNoTheme", and the html to include the GWT modules, the behaviour of the GWT Textbox changes so that if i press enter, the autocomplete results are cleared...
I am not super-great at GWT/SmartGWT interoperability, so it would be fantastic if someone could chip in with thoughts about what i can do, if anything.
I am happy to share my entire project, but since i can't upload zip files, i uploaded the main Java entrypoint-class. Let me know if i can provide any more information.
We use maps a lot in our app, utilizing the classic Branflake maps project for GWT bindings to the JS Maps api.
In one place, we have a mapwidget with a TextBox used with Googles AutoComplete feature, which has worked fine. When user enters text, autocomplete will present some suggestions, and user can click on them. We can use that to move the map around.
Now, i tried doing a little tweak today. Basically i wanted that if the user just presses enter, we'd click on the first row in the autocomplete results and use that. The only way to do that is by catching the press event and sending a "key down" event, since there is no API access to the data. (Tons of SO threads about this)
However, i noticed, that when i press enter in the autocomplete box, the dropdown with suggestions disappear. This is strange, since it does not happen in the maps showcase.
You can test the functionality as exptected in the Branflake showcase (http://gonevertical-apis.appspot.com), scroll down to the "autocomplete" widget and notice that when you have search results, you can press enter in the text box without the results disappearing.
----
After several hours of experimenting, i have come to the following scenario:
I have a small stand-alone, runnable test project that just adds a GWT TextBox and a mapwidget to the RootPanel, which works as expected.
If i just use GWT components, i can press enter in the search box without the dropdown disappearing.
If i then just change gwt.xml to include the "SmartGwtEENoScriptNoTheme", and the html to include the GWT modules, the behaviour of the GWT Textbox changes so that if i press enter, the autocomplete results are cleared...
I am not super-great at GWT/SmartGWT interoperability, so it would be fantastic if someone could chip in with thoughts about what i can do, if anything.
I am happy to share my entire project, but since i can't upload zip files, i uploaded the main Java entrypoint-class. Let me know if i can provide any more information.
Comment