Saturday, October 27, 2012

iframe event / gwt 2.5

Hi,

I want to fire a popup when i click in an iFrame and get the target element in order to recover his id. Why the ONCLICK event don't work ?
The ONLOAD work perfectly.

Thanks

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://examples.roughian.com/index.htm#Listeners~EventListener");
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;
        }
    }
}

--
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/-/leQwWBqEOp0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate