public void execute() { fireEvent(new SubmitCompleteEvent(impl.getContents(synthesizedFrame))); } });
@Override protected void onAttach() { super.onAttach(); if (frameName != null) { // Create and attach a hidden iframe to the body element. createFrame(); Document.get().getBody().appendChild(synthesizedFrame); } // Hook up the underlying iframe's onLoad event when attached to the DOM. // 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. impl.hookEvents(synthesizedFrame, getElement(), this); }
/** * Sets the encoding used for submitting this form. This should be either * {@link #ENCODING_MULTIPART} or {@link #ENCODING_URLENCODED}. * * @param encodingType the form's encoding */ public void setEncoding(String encodingType) { impl.setEncoding(getElement(), encodingType); }
@Override protected void onDetach() { super.onDetach(); // Unhook the iframe's onLoad when detached. impl.unhookEvents(synthesizedFrame, getElement()); if (synthesizedFrame != null) { // And remove it from the document. Document.get().getBody().removeChild(synthesizedFrame); synthesizedFrame = null; } }
/** * Submits the form. * * <p> * The FormPanel must <em>not</em> be detached (i.e. removed from its parent * or otherwise disconnected from a {@link RootPanel}) until the submission is * complete. Otherwise, notification of submission will fail. * </p> */ public void submit() { // Fire the onSubmit event, because javascript's form.submit() does not // fire the built-in onsubmit event. if (!fireSubmitEvent()) { return; } impl.submit(getElement(), synthesizedFrame); }
/** * Resets the form, clearing all fields. */ public void reset() { impl.reset(getElement()); }
/** * Gets the encoding used for submitting this form. This should be either * {@link #ENCODING_MULTIPART} or {@link #ENCODING_URLENCODED}. * * @return the form's encoding */ public String getEncoding() { return impl.getEncoding(getElement()); }
@Override protected void onDetach() { super.onDetach(); impl.unhookEvents(iframe, form.dom); XDOM.getBody().removeChild(iframe); iframe = null; }
/** * Submits form */ public void submit() { // Fire the onSubmit event, because javascript's form.submit() does not // fire the built-in onsubmit event. if (!fireSubmitEvent()) { return; } impl.submit(getElement(), synthesizedFrame); }
/** * Resets the form, clearing all fields. */ public void reset() { impl.reset(getElement()); }
/** * Gets the encoding used for submitting this form. This should be either * {@link #ENCODING_MULTIPART} or {@link #ENCODING_URLENCODED}. * * @return the form's encoding */ public String getEncoding() { return impl.getEncoding(getElement()); }
private static String getResultsHtml(FormPanelImpl impl, Element synthesizedFrame) { if (synthesizedFrame != null) { return impl.getContents(synthesizedFrame); } else { return null; } }
/** * Sets the encoding used for submitting this form. * * @param encoding the encoding */ public void setEncoding(Encoding encoding) { this.encoding = encoding; if (rendered) { impl.setEncoding(form.dom, encoding.value); } }
@Override protected void onDetach() { super.onDetach(); // Unhook the iframe's onLoad when detached. impl.unhookEvents(synthesizedFrame, getElement()); if (synthesizedFrame != null) { // And remove it from the document. Document.get().getBody().removeChild(synthesizedFrame); synthesizedFrame = null; } }
@Override protected void onAttach() { super.onAttach(); createFrame(); XDOM.getBody().appendChild(iframe); impl.hookEvents(iframe, form.dom, this); }
/** * Submits form */ public void submit() { // Fire the onSubmit event, because javascript's form.submit() does not // fire the built-in onsubmit event. if (!fireSubmitEvent()) { return; } impl.submit(getElement(), synthesizedFrame); }
/** * Resets the form, clearing all fields. */ public void reset() { impl.reset(getElement()); }
/** * Gets the encoding used for submitting this form. This should be either * {@link #ENCODING_MULTIPART} or {@link #ENCODING_URLENCODED}. * * @return the form's encoding */ public String getEncoding() { return impl.getEncoding(getElement()); }
private static String getResultsHtml(FormPanelImpl impl, Element synthesizedFrame) { if (synthesizedFrame != null) { return impl.getContents(synthesizedFrame); } else { return null; } }
/** * Sets the encoding used for submitting this form. This should be either * {@link FormPanel#ENCODING_MULTIPART} or {@link FormPanel#ENCODING_URLENCODED}. * * @param encodingType * the form's encoding */ public void setEncoding(String encodingType) { impl.setEncoding(getElement(), encodingType); }