org.apache.click.control
Class Submit

java.lang.Object
  extended by org.apache.click.control.AbstractControl
      extended by org.apache.click.control.Field
          extended by org.apache.click.control.Button
              extended by org.apache.click.control.Submit
All Implemented Interfaces:
Serializable, Control, Stateful
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

See Also:
Serialized Form

Field Summary
protected  boolean clicked
          The button is clicked.
 
Fields inherited from class org.apache.click.control.Field
disabled, error, focus, form, help, label, labelStyle, labelStyleClass, parentStyleClassHint, parentStyleHint, readonly, required, tabindex, title, trim, validate, value
 
Fields inherited from class org.apache.click.control.AbstractControl
actionListener, attributes, behaviors, headElements, listener, listenerMethod, messages, name, parent, styles
 
Fields inherited from interface org.apache.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 org.apache.click.control.Button
getControlSizeEst, getOnClick, getTag, render, setOnClick
 
Methods inherited from class org.apache.click.control.Field
getError, getErrorLabel, getFocus, getFocusJavaScript, getForm, getHelp, getId, getLabel, getLabelStyle, getLabelStyleClass, getParentStyleClassHint, getParentStyleHint, getRequestValue, getState, getTabIndex, getTextAlign, getTitle, getValidate, getValidationJavaScript, getValue, getValueObject, getWidth, isDisabled, isHidden, isReadonly, isRequired, isTrim, isValid, removeState, renderTagBegin, restoreState, saveState, setDisabled, setError, setErrorMessage, setErrorMessage, setFocus, setForm, setHelp, setLabel, setLabelStyle, setLabelStyleClass, setListener, setParent, setParentStyleClassHint, setParentStyleHint, setReadonly, setRequired, setState, setTabIndex, setTextAlign, setTitle, setTrim, setValidate, setValue, setValueObject, setWidth, validate
 
Methods inherited from class org.apache.click.control.AbstractControl
addBehavior, addStyleClass, appendAttributes, dispatchActionEvent, getActionListener, getAttribute, getAttributes, getBehaviors, getContext, getHeadElements, getHtmlImports, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, hasAttribute, hasAttributes, hasBehaviors, hasStyles, isAjaxTarget, onDeploy, onDestroy, onInit, onRender, removeBehavior, removeStyleClass, 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.

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()