net.sf.click.control
Class Submit

java.lang.Object
  extended bynet.sf.click.control.AbstractControl
      extended bynet.sf.click.control.Field
          extended bynet.sf.click.control.Button
              extended bynet.sf.click.control.Submit
All Implemented Interfaces:
Control, Serializable
Direct Known Subclasses:
ImageSubmit

public class Submit
extends Button

Provides a Submit control:   <input type='submit'>.

The Submit control supports server side processing and can be used to invoke Control listeners.

For an Submit code example see the Form Javadoc example.

See also the W3C HTML reference INPUT

Author:
Malcolm Edgar
See Also:
Serialized Form

Field Summary
protected  boolean clicked
          The button is clicked.
 
Fields inherited from class net.sf.click.control.Field
disabled, error, focus, form, help, label, readonly, required, tabindex, title, validate, value
 
Fields inherited from class net.sf.click.control.AbstractControl
actionListener, attributes, listener, listenerMethod, messages, name, parent, styles
 
Fields inherited from interface net.sf.click.Control
CONTROL_MESSAGES
 
Constructor Summary
Submit()
          Create an Submit button with no name defined.
Submit(String name)
          Create a Submit button with the given name.
Submit(String name, Object listener, String method)
          Create a Submit button with the given name, listener object and listener method.
Submit(String name, String label)
          Create a Submit button with the given name and label.
Submit(String name, String label, Object listener, String method)
          Create a Submit button with the given name, label, listener object and listener method.
 
Method Summary
 void bindRequestValue()
          Bind the request submission, setting the Field.value and clicked properties if defined.
 boolean getCancelJavaScriptValidation()
          Return true if client side JavaScript form validation will be cancelled by pressing this button.
 String getType()
          Return the input type: 'submit'.
 boolean isClicked()
          Returns the true if the submit button was clicked, or false otherwise.
 boolean onProcess()
          Process the submit event and return true to continue event processing.
 void setCancelJavaScriptValidation(boolean cancel)
          Set whether client side JavaScript form validation will be cancelled by pressing this button.
 
Methods inherited from class net.sf.click.control.Button
getControlSizeEst, getOnClick, getTag, onRender, render, setOnClick
 
Methods inherited from class net.sf.click.control.Field
getError, getErrorLabel, getFocus, getFocusJavaScript, getForm, getHelp, getId, getLabel, getRequestValue, getTabIndex, getTextAlign, getTitle, getValidate, getValidationJavaScript, getValue, getValueObject, getWidth, isDisabled, isHidden, isReadonly, isRequired, isValid, onInit, setDisabled, setError, setErrorMessage, setErrorMessage, setErrorMessage, setErrorMessage, setFocus, setForm, setHelp, setLabel, setListener, setParent, setReadonly, setRequired, setTabIndex, setTextAlign, setTitle, setValidate, setValue, setValueObject, setWidth, validate
 
Methods inherited from class net.sf.click.control.AbstractControl
addStyleClass, appendAttributes, getActionListener, getAttribute, getAttributes, getContext, getHtmlImports, getMessage, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, hasAttribute, hasAttributes, hasStyles, onDeploy, onDestroy, registerActionEvent, removeStyleClass, renderTagBegin, renderTagEnd, setActionListener, setAttribute, setId, setName, setStyle, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clicked

protected boolean clicked
The button is clicked.

Constructor Detail

Submit

public Submit(String name)
Create a Submit button with the given name.

Parameters:
name - the button name

Submit

public Submit(String name,
              String label)
Create a Submit button with the given name and label.

Parameters:
name - the button name
label - the button display label

Submit

public Submit(String name,
              Object listener,
              String method)
Create a Submit button with the given name, listener object and listener method.

Parameters:
name - the button name
listener - the listener target object
method - the listener method to call
Throws:
IllegalArgumentException - if listener is null or if the method is blank

Submit

public Submit(String name,
              String label,
              Object listener,
              String method)
Create a Submit button with the given name, label, listener object and listener method.

Parameters:
name - the button name
label - the button display label
listener - the listener target object
method - the listener method to call
Throws:
IllegalArgumentException - if listener is null or if the method is blank

Submit

public Submit()
Create an Submit button with no name defined.

Please note the control's name must be defined before it is valid.

Method Detail

getCancelJavaScriptValidation

public boolean getCancelJavaScriptValidation()
Return true if client side JavaScript form validation will be cancelled by pressing this button.

Returns:
true if button will cancel JavaScript form validation

setCancelJavaScriptValidation

public void setCancelJavaScriptValidation(boolean cancel)
Set whether client side JavaScript form validation will be cancelled by pressing this button.

Parameters:
cancel - the cancel JavaScript form validation flag

isClicked

public boolean isClicked()
Returns the true if the submit button was clicked, or false otherwise.

Returns:
the true if the submit button was clicked

getType

public String getType()
Return the input type: 'submit'.

Overrides:
getType in class Button
Returns:
the input type: 'submit'

bindRequestValue

public void bindRequestValue()
Bind the request submission, setting the Field.value and clicked properties if defined.

Overrides:
bindRequestValue in class Field

onProcess

public boolean onProcess()
Process the submit event and return true to continue event processing.

If the submit button is clicked and a Control listener is defined, the listener method will be invoked and its boolean return value will be returned by this method.

Submit buttons will be processed after all the non Button Form Controls have been processed. Submit buttons will be processed in the order they were added to the Form.

Specified by:
onProcess in interface Control
Overrides:
onProcess in class Button
Returns:
true to continue Page event processing or false otherwise
See Also:
Field.onProcess()