org.apache.empire.struts2.actionsupport
Class FormActionSupport

java.lang.Object
  extended by org.apache.empire.struts2.actionsupport.FormActionSupport
Direct Known Subclasses:
RecordFormActionSupport

public abstract class FormActionSupport
extends Object


Field Summary
protected  ActionBase action
           
protected static org.slf4j.Logger log
           
protected  String propertyName
           
 
Constructor Summary
protected FormActionSupport(ActionBase action, String propertyName)
          Creates a new FormActionSupport object.
 
Method Summary
protected  void addFieldError(String name, Column column, ErrorInfo error, Object value)
          overridable: sets a field error message on the action
protected  String getActionParam(String name, boolean persist)
          Returns the value of a paramether supplied with the request or the session
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.slf4j.Logger log

action

protected ActionBase action

propertyName

protected String propertyName
Constructor Detail

FormActionSupport

protected FormActionSupport(ActionBase action,
                            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 String getRecordPropertyName()
Returns the property name of this form support object

Returns:
the property name

getActionParam

protected String getActionParam(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(String name,
                             Column column,
                             ErrorInfo error,
                             Object value)
overridable: sets a field error message on the action



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