Zn2O / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

InfoWindow shows empty content after being closed and reopened several times #181

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release: Maps, 1.0 RC1

Detailed description:

There is a click handler on each marker on the map. This handler opens info
window and creates Grid subclass widget inside it with some info.

After clicking several times on different markers, seeing appropriate info
windows and closing every window, press close for next window and after
this all next windows show empty content.

That is the method in the click handler:

        public void onClick(MarkerClickEvent event) {
                Marker marker = event.getSender();
                map.getInfoWindow().open(marker, new InfoWindowContent(new
MapObjectInfo(data)));
                map.setCenter(marker.getLatLng());
        }

Here MapObjectInfo is subclass of the Grid widget with some basic
initialization stuff.

After a little research it was noticed that while using simple String in
the InfoWindow the issue doesn't appear any more.
Also if the widget, which is used as window content, is constructed every
time directly in the MarkerClickHandler, then info window shows empty
content only after many (20-30) "opens" and "closes".

The example of such code is:

public class MarkerClickHandler implements
com.google.gwt.maps.client.event.MarkerClickHandler {

public void onClick(MarkerClickEvent event) {
        Marker marker = event.getSender();
        map.getInfoWindow().open(marker, new
InfoWindowContent(createWindowContent(data)));
        map.setCenter(marker.getLatLng());
    }

    private Grid createWindowContent(MapObjectDTO mapObject) {
        ...
    }
}

The issue was discovered on Linux, Firefox 3.0

Links to the relevant GWT Developer Forum posts:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/2e29dd59c
907e0c2

Original issue reported on code.google.com by alexey.f...@gmail.com on 28 Sep 2008 at 8:50

GoogleCodeExporter commented 9 years ago
This is possibly the same as issue 156.  

Original comment by galgwt.reviews@gmail.com on 28 Sep 2008 at 7:56

GoogleCodeExporter commented 9 years ago
Thanks for the detailed report.  See issue 156.

Original comment by galgwt.reviews@gmail.com on 6 Oct 2008 at 7:50