Zn2O / gwt-google-apis

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

The widget passed as the maximize content ignores onClick() events #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
r290

Detailed description:
Stuart reports:

"In the code below, the "maximize" widget retains its listener (and it
works) while the "minimize" widget loses its click listener. "

(The expected behavior is that clicking on the word 'minimize' will restore
the InfoWindow back to its original size.)

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class InfoWindowSample implements EntryPoint {

 /**
  * This is the entry point method.
  */
 public void onModuleLoad() {

     // create map
     MapWidget map = new MapWidget();
     final LatLng center = new LatLng(40.7649615,-111.8460488);
     map.setCenter(center);
     map.setSize("600", "300");

     // create a marker
     Marker marker = new Marker(center);

     // setup an info window
     final InfoWindow infoWindow = map.getInfoWindow();

     // info window content
     HTML maximize = new HTML("maximize");
     maximize.addClickListener(new ClickListener(){
       public void onClick(Widget sender) {
           infoWindow.maximize();
       }
     });

     final InfoWindowContent infoWindowContent = new
InfoWindowContent(maximize);

     // max content for the info window
     HTML minimize = new HTML("minimize");
     minimize.addClickListener(new ClickListener(){
       public void onClick(Widget sender) {
           infoWindow.restore();
       }
     });
     infoWindowContent.setMaxContent(minimize);
     infoWindowContent.setMaxTitle("Max content title");

     // a listener for the marker
     marker.addMarkerClickHandler(new MarkerClickHandler(){

       public void onClick(MarkerClickEvent event) {
           infoWindow.open(center, infoWindowContent);
       }

     });

     // add marker to map
     map.addOverlay(marker);

     // place the map
     RootPanel.get().add(map);
 }
}

Workaround if you have one:
None known.

Links to the relevant GWT Developer Forum posts:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/d58046758
eeb3cd2/bf2b9b8a226fda23?lnk=gst&q=maximize+map#bf2b9b8a226fda23

Original issue reported on code.google.com by galgwt.reviews@gmail.com on 12 May 2008 at 2:50

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 12 May 2008 at 3:32

Attachments:

GoogleCodeExporter commented 9 years ago
Working like a charm in my sandbox. Thanks for the quick fix. I will watch for 
the
approved review and the update to the trunk.

You just added a major "wow factor" feature for my application, so thanks.

Stuart

Original comment by stuartmo...@gmail.com on 12 May 2008 at 6:20

GoogleCodeExporter commented 9 years ago
Committed as r311

Original comment by galgwt.reviews@gmail.com on 6 Jun 2008 at 4:04

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 13 Oct 2008 at 8:54

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 11 Dec 2008 at 3:08

GoogleCodeExporter commented 9 years ago

Original comment by zundel@google.com on 21 Dec 2009 at 1:57