org.apache.empire.struts2.actionsupport
Class FormActionSupport

java.lang.Object
  extended by org.apache.empire.commons.ErrorObject
      extended by org.apache.empire.struts2.actionsupport.FormActionSupport
All Implemented Interfaces:
ErrorInfo
Direct Known Subclasses:
RecordFormActionSupport

public abstract class FormActionSupport
extends ErrorObject


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.empire.commons.ErrorObject
ErrorObject.ObjectErrorInfo
 
Field Summary
protected  ActionBase action
           
protected static org.apache.commons.logging.Log log
           
protected  java.lang.String propertyName
           
 
Constructor Summary
protected FormActionSupport(ActionBase action, java.lang.String propertyName)
          Creates a new FormActionSupport object.
 
Method Summary
protected  void addFieldError(java.lang.String name, Column column, ErrorInfo error, java.lang.Object value)
          overridable: sets a field error message on the action
protected  java.lang.String getActionParam(java.lang.String name, boolean persist)
          Returns the value of a paramether supplied with the request or the session
 java.lang.String getRecordPropertyName()
          Returns the property name of this form support object
 boolean isEnableFieldErrors()
          Returns true if field error handling is enabled or false otherwise.
abstract  boolean loadFormData()
          load the form data into an object.
 void setEnableFieldErrors(boolean enableFieldErrors)
          Enables or disables field error messages.
 
Methods inherited from class org.apache.empire.commons.ErrorObject
clearError, clearErrorInfo, error, error, error, error, error, error, error, getErrorInfo, getErrorMessage, getErrorParams, getErrorSource, getErrorType, getMessage, hasError, internalSetError, isExceptionsEnabled, setExceptionsEnabled, success
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

action

protected ActionBase action

propertyName

protected java.lang.String propertyName
Constructor Detail

FormActionSupport

protected FormActionSupport(ActionBase action,
                            java.lang.String propertyName)
Creates a new FormActionSupport object.

Parameters:
action - the action this object belongs to
propertyName - the name of the properties
Method Detail

isEnableFieldErrors

public final boolean isEnableFieldErrors()
Returns true if field error handling is enabled or false otherwise.

Returns:
true if field error handling is enabled or false otherwise.

setEnableFieldErrors

public final void setEnableFieldErrors(boolean enableFieldErrors)
Enables or disables field error messages.

Parameters:
enableFieldErrors - true to enable field errors or false otherwise

getRecordPropertyName

public java.lang.String getRecordPropertyName()
Returns the property name of this form support object

Returns:
the property name

getActionParam

protected java.lang.String getActionParam(java.lang.String name,
                                          boolean persist)
Returns the value of a paramether supplied with the request or the session

Parameters:
name - the name of the parameter
persist - true if the request value should be persisted on the session or false otherwise.
Returns:
the value of the parameter or null if not supplied.

loadFormData

public abstract boolean loadFormData()
load the form data into an object.

Returns:
true if loading the form data was successful or false otherwise.

addFieldError

protected void addFieldError(java.lang.String name,
                             Column column,
                             ErrorInfo error,
                             java.lang.Object value)
overridable: sets a field error message on the action



Copyright © 2008-2010 Apache Software Foundation. All Rights Reserved.