Hi, I am actually migrate a web application to GWT. In order to reuse the existing page i put them in frame. However i have to develop a new popup for one of them and i would like to let this popup attached to the main module. Before i was parsing the html to get the element and with RootPanel attach a button. I can't do that anymore because it's in an Iframe. So i try to fire an event on click inside the iFrame to get the current element and if it's the right button show the popup ...
The ONLOAD event work pretty well but the ONCLICK don't work at all my code sample : package com.exp.client; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.Frame; import com.google.gwt.user.client.Window; public class CustomFrame extends Frame { public CustomFrame(){ sinkEvents(Event.ONCLICK); sinkEvents(Event.ONLOAD); setUrl("http://www.google.com"); setSize("900px","900px"); } public void onBrowserEvent(Event event){ super.onBrowserEvent(event); switch (DOM.eventGetType(event)) { case Event.ONCLICK: Window.alert("ONCLICK : "+ event.getEventTarget().toString() ); DOM.eventPreventDefault(event); break; case Event.ONLOAD: Window.alert("ONLOAD"); DOM.eventPreventDefault(event); break; } } } Thanks for your help -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/-_OuFX0mHJUJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.