diff options
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSubmitButton.java')
| -rw-r--r-- | projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSubmitButton.java | 77 |
1 files changed, 40 insertions, 37 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSubmitButton.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSubmitButton.java index 05824f3..a1ef303 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSubmitButton.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSubmitButton.java @@ -22,49 +22,52 @@ import net.wotonomy.foundation.NSDictionary; import net.wotonomy.foundation.NSMutableArray; /** -* Implements a submit button with dynamic bindings. -* @author michael@mpowers.net -* @author $Author: cgruber $ -* @version $Revision: 905 $ -*/ + * Implements a submit button with dynamic bindings. + * + * @author michael@mpowers.net + * @author $Author: cgruber $ + * @version $Revision: 905 $ + */ public class WOSubmitButton extends WOInput { - public WOSubmitButton() { - super(); - } + public WOSubmitButton() { + super(); + } - public WOSubmitButton(String n, NSDictionary m, WOElement t) { - super(n, m, t); - } + public WOSubmitButton(String n, NSDictionary m, WOElement t) { + super(n, m, t); + } - protected String inputType() { - return "SUBMIT"; - } + protected String inputType() { + return "SUBMIT"; + } - protected Object value(WOContext c) { - Object v = valueForProperty("value", c.component()); - if (v == null) { - return "Submit"; - } - return v; - } + protected Object value(WOContext c) { + Object v = valueForProperty("value", c.component()); + if (v == null) { + return "Submit"; + } + return v; + } - protected NSMutableArray additionalAttributes() { - NSMutableArray a = super.additionalAttributes(); - a.add("action"); - return a; - } + protected NSMutableArray additionalAttributes() { + NSMutableArray a = super.additionalAttributes(); + a.add("action"); + return a; + } - public WOActionResults invokeAction(WORequest r, WOContext c) { - if (disabled(c)) - return null; - //It's useless to check the senderID here because it's going to be for the form always. - //So we check if the formValues contain the button's name (which means it was pressed) - if (r.formValueForKey(inputName(c)) != null) { - if (associations.objectForKey("action") != null) - return (WOActionResults)valueForProperty("action", c.component()); - } - return null; - } + public WOActionResults invokeAction(WORequest r, WOContext c) { + if (disabled(c)) + return null; + // It's useless to check the senderID here because it's going to be for the form + // always. + // So we check if the formValues contain the button's name (which means it was + // pressed) + if (r.formValueForKey(inputName(c)) != null) { + if (associations.objectForKey("action") != null) + return (WOActionResults) valueForProperty("action", c.component()); + } + return null; + } } |
