I have a frame panel
Frame frameExample = new Frame();
I need to hide the frame when I click on it, I know the method setvisible
frameExample.setVisible(false);
But how can add onclick
handler on frame in gwt?
To add handler for known DOM events on Frame you should use addDomHandler api. Frame extends from Widget and widget has addDomHandler api.
Also from the addDomHandler java doc
/**
* Adds a native event handler to the widget and sinks the corresponding
* native event. If you do not want to sink the native event, use the generic
* addHandler method instead.
*/
However i am not sure whether Click event is supported by Frame. A quick stackoveflow search for similar javascript problem gives Detect Click into Iframe using JavaScript.