/** * Set, whether this form is to be transmitted via <code>POST</code> (true) * or <code>GET</code> (false). The default, and this is what you * usually want, is <code>POST</code>. */ public void setPostMethod(boolean postMethod) { boolean oldVal = this.postMethod; if (isDifferent(this.postMethod, postMethod)) update(getCG().getMethodUpdate(this, postMethod ? "post" : "get")); this.postMethod = postMethod; propertyChangeSupport.firePropertyChange("postMethod", oldVal, this.postMethod); }
/** * Set the encoding of this form. This actually is an HTML interna * that bubbles up here. By default, the encoding type of any HTML-form * is <code>application/x-www-form-urlencoded</code>, and as such, needn't * be explicitly set with this setter. However, if you've included a * file upload element (as represented by {@link SFileChooser}) in your * form, this must be set to <code>multipart/form-data</code>, since only * then, files are transmitted correctly. In 'normal' forms without * file upload, it is not necessary to set it to * <code>multipart/form-data</code>; actually it enlarges the data to * be transmitted, so you probably don't want to do this, then. * * @param type the encoding type; one of <code>multipart/form-data</code>, * <code>application/x-www-form-urlencoded</code> or null to detect encoding. */ public void setEncodingType(String type) { String oldVal = this.encType; if (isDifferent(encType, type)) update(getCG().getEncodingUpdate(this, type)); encType = type; propertyChangeSupport.firePropertyChange("encodingType", oldVal, this.encType); }
/** * Set the default button activated upon <b>enter</b>. * The button is triggered if you press <b>enter</b> inside a form to submit it. * @param defaultButton A button which will be rendered <b>invisible</b>. * If <code>null</code> enter key pressed will be catched by the wings framework. */ public void setDefaultButton(SButton defaultButton) { SButton oldButton = this.defaultButton; String oldName = oldButton != null ? oldButton.getName() : null; String newName = defaultButton != null ? defaultButton.getName() : null; if (isDifferent(oldName, newName)) update(getCG().getDefaultButtonNameUpdate(this, newName)); this.defaultButton = defaultButton; propertyChangeSupport.firePropertyChange("defaultButton", oldButton, this.defaultButton); }