1
我有一個幀面板GWT隱藏幀
Frame frameExample = new Frame();
我需要隱藏幀,當我點擊它,我知道方法setvisible
frameExample.setVisible(false);
但如何才能在添加onclick
處理程序框架在gwt?
我有一個幀面板GWT隱藏幀
Frame frameExample = new Frame();
我需要隱藏幀,當我點擊它,我知道方法setvisible
frameExample.setVisible(false);
但如何才能在添加onclick
處理程序框架在gwt?
要爲Frame上的已知DOM事件添加處理程序,您應該使用addDomHandler api。框架從Widget擴展並且Widget具有addDomHandler API。
從addDomHandler Java文檔/**
* 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.
*/
也不過我不知道Click事件是否是由框架支撐。快速stackoveflow搜索類似的JavaScript問題給出Detect Click into Iframe using JavaScript。
GWT [框架](http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Frame.html)類包裝**'
@Boris你是對的。編輯答案。 – SSR