Example usage for com.google.gwt.user.client.ui.impl FormPanelImplHost FormPanelImplHost

List of usage examples for com.google.gwt.user.client.ui.impl FormPanelImplHost FormPanelImplHost

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui.impl FormPanelImplHost FormPanelImplHost.

Prototype

FormPanelImplHost

Source Link

Usage

From source file:rocket.widget.client.FormPanel.java

License:Apache License

@Override
protected void onAttach() {
    super.onAttach();

    // Create and attach a hidden iframe to the body element.
    final Element iframe = createIFrame();
    this.setIFrame(iframe);
    RootPanel.getBodyElement().appendChild(iframe);

    // Hook up the underlying iframe's onLoad event when attached to the
    // DOM./* www  .  ja  v a 2  s . co m*/
    // Making this connection only when attached avoids memory-leak issues.
    // The FormPanel cannot use the built-in GWT event-handling mechanism
    // because there is no standard onLoad event on iframes that works
    // across
    // browsers.
    FormPanel.getSupport().hookEvents(iframe, getElement(), new FormPanelImplHost() {

        public boolean onFormSubmit() {
            return FormPanel.this.onFormSubmit();
        }

        public void onFrameLoad() {
            FormPanel.this.onFrameLoad();
        }
    });
}