Maps API v3 - Buttons and TextBoxes inside InfoWindow??

1,402 views
Skip to first unread message

André Salvati

unread,
Jul 17, 2012, 11:46:26 AM7/17/12
to gwt-goo...@googlegroups.com
Is it possible to capture events from widgets that are inside Infowindow?

Tried code above (button.addAttachHandler) and doesn't show the alert:

Marker m = Marker.create();
m.setIcon(MarkerImage.create(icone));
m.setPosition(LatLng.create(posicao.lat(), posicao.lng()));
m.setMap(map);
m.addClickListener(new ClickHandler() {
@Override
public void handle(MouseEvent event) {
       InfoWindow info = InfoWindow.create();
       HTMLPanel html = new HTMLPanel(("<div id='button'></div>"));
       Button button = new Button("Desativar");
       
       button.addAttachHandler(new Handler() {
@Override
public void onAttachOrDetach(AttachEvent event) {
Window.alert("atachou");
}
});
         
       html.add(button, "button");
       info.setContent(html.getElement());
       info.setPosition(posicao);
       info.open(map);           
   }
});

André Salvati

unread,
Jul 19, 2012, 9:25:53 AM7/19/12
to gwt-goo...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages