From: Christopher N. <cna...@gm...> - 2010-02-18 21:07:26
|
Hi, I have a question about the addCloseListener method for Popup. My CloseListener callback is executed if I create a Popup; however, if I instead create a FramedCloud Popup which extends Popup, the callback function never gets called and I am not sure why there is a disconnect. The code below works just fine: final Popup popup = new Popup( "myid", vectorFeature.getCenterLonLat(), null, text, true ); popup.addCloseListener( new CloseListener() { public void onPopupClose( JSObject evt ) { Window.alert("callback executed"); } }); vectorFeature.setPopup( popup ); map.addPopup( vectorFeature.getPopup() ); With the above code, the alert message is displayed when the popup is closed. If I change the first line to: final FramedCloud popup = new FramedCloud( "myid", vectorFeature.getCenterLonLat(), null, text, null, true ); and leave the rest of the code the same, then the FramedCloud's CloseListener callback is never called. Any ideas why the callback doesn't work with FramedCloud? Am I doing something wrong? Thanks, Chris |