/** * Creates a new FormPanel. When created using this constructor, it will be * submitted either by replacing the current page, or to the named * <iframe>. * * <p> * When the FormPanel targets an external frame in this way, it will not fire * the FormSubmitComplete event. * </p> * * @param target the name of the <iframe> to receive the results of the * submission, or <code>null</code> to specify that the current page * be replaced */ public FormPanel(String target) { super(Document.get().createFormElement()); setTarget(target); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <form> element. * * <p> * If the createIFrame parameter is set to <code>true</code>, then the wrapped * form's target attribute will be set to a hidden iframe. If not, the form's * target will be left alone, and the FormSubmitComplete event will not be * fired. * </p> * * @param element the element to be used * @param createIFrame <code>true</code> to create an <iframe> element * that will be targeted by this form */ protected FormPanel(Element element, boolean createIFrame) { super(element); FormElement.as(element); if (createIFrame) { assert ((getTarget() == null) || (getTarget().trim().length() == 0)) : "Cannot create target iframe if the form's target is already set."; // We use the module name as part of the unique ID to ensure that ids are // unique across modules. frameName = "FormPanel_" + GWT.getModuleName() + "_" + (++formId); setTarget(frameName); sinkEvents(Event.ONLOAD); } }
/** * Creates a new FormPanel. When created using this constructor, it will be * submitted either by replacing the current page, or to the named * <iframe>. * * <p> * When the FormPanel targets an external frame in this way, it will not fire * the FormSubmitComplete event. * </p> * * @param target the name of the <iframe> to receive the results of the * submission, or <code>null</code> to specify that the current page * be replaced */ public FormPanel(String target) { super(Document.get().createFormElement()); setTarget(target); }
/** * Creates a new FormPanel. When created using this constructor, it will be * submitted either by replacing the current page, or to the named * <iframe>. * * <p> * When the FormPanel targets an external frame in this way, it will not fire * the FormSubmitComplete event. * </p> * * @param target the name of the <iframe> to receive the results of the * submission, or <code>null</code> to specify that the current page * be replaced */ public FormPanel(String target) { super(Document.get().createFormElement()); setTarget(target); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <form> element. * * <p> * If the createIFrame parameter is set to <code>true</code>, then the wrapped * form's target attribute will be set to a hidden iframe. If not, the form's * target will be left alone, and the FormSubmitComplete event will not be * fired. * </p> * * @param element the element to be used * @param createIFrame <code>true</code> to create an <iframe> element * that will be targeted by this form */ protected FormPanel(Element element, boolean createIFrame) { super(element); FormElement.as(element); if (createIFrame) { assert ((getTarget() == null) || (getTarget().trim().length() == 0)) : "Cannot create target iframe if the form's target is already set."; // We use the module name as part of the unique ID to ensure that ids are // unique across modules. frameName = "FormPanel_" + GWT.getModuleName() + "_" + (++formId); setTarget(frameName); sinkEvents(Event.ONLOAD); } }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <form> element. * * <p> * If the createIFrame parameter is set to <code>true</code>, then the wrapped * form's target attribute will be set to a hidden iframe. If not, the form's * target will be left alone, and the FormSubmitComplete event will not be * fired. * </p> * * @param element the element to be used * @param createIFrame <code>true</code> to create an <iframe> element * that will be targeted by this form */ protected FormPanel(Element element, boolean createIFrame) { super(element); FormElement.as(element); if (createIFrame) { assert ((getTarget() == null) || (getTarget().trim().length() == 0)) : "Cannot create target iframe if the form's target is already set."; // We use the module name as part of the unique ID to ensure that ids are // unique across modules. frameName = "FormPanel_" + GWT.getModuleName() + "_" + (++formId); setTarget(frameName); sinkEvents(Event.ONLOAD); } }