org.apache.empire.struts2.jsp.controls
Class InputControl

java.lang.Object
  extended by org.apache.empire.struts2.jsp.controls.InputControl
Direct Known Subclasses:
CheckboxInputControl, PasswordInputControl, PhoneInputControl, RadioInputControl, SelectInputControl, TextAreaInputControl, TextInputControl

public abstract class InputControl
extends java.lang.Object


Nested Class Summary
static interface InputControl.ControlInfo
          This interface extends the value information by information about the input control used with the renderInput function
static class InputControl.FieldValueError
          This class wraps a parsing or validation error.
static interface InputControl.ValueInfo
          This interface allows access to a value and its metainformation used with the renderData function
 
Field Summary
static java.lang.String CURRENCY_CODE_ATTRIBUTE
           
static java.lang.String FILE_DATA_COLUMN_ATTRIBUTE
           
static java.lang.String MAXVALUE_ATTRIBUTE
           
static java.lang.String MINVALUE_ATTRIBUTE
           
static java.lang.Object NO_VALUE
          The NO_VALUE constant is used as a return value from getFieldValue to indicate that the value for this column has not been provided
static java.lang.Object NULL_VALUE
          The NULL_VALUE constant is used as a return value from getFieldValue to indicate that the field value was provided with the request, but is empty so that the underlying database field should be set to null
static java.lang.String NUMBER_FORMAT_ATTRIBUTE
           
static java.lang.String NUMBER_FRACTION_DIGITS
           
static java.lang.String NUMBER_GROUPSEP_ATTRIBUTE
           
 
Constructor Summary
InputControl()
           
 
Method Summary
 java.lang.Object getFieldValue(java.lang.String name, RequestParamProvider request, java.util.Locale locale, org.apache.empire.data.Column column)
          this method parses and validates the value of a particular column from the request
abstract  void renderInput(HtmlWriter writer, InputControl.ControlInfo ci)
          this method renders a record value for input
 void renderText(HtmlWriter writer, InputControl.ValueInfo vi)
          this method renders a record value read only this can be either in a read only form or a table
 boolean useLabelId()
          This method determines whether an id should be put on the input label If true than the renderInput function must add an id attribute to an input field The value of the id is supplied with the ControlInfo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_FORMAT_ATTRIBUTE

public static final java.lang.String NUMBER_FORMAT_ATTRIBUTE
See Also:
Constant Field Values

NUMBER_GROUPSEP_ATTRIBUTE

public static final java.lang.String NUMBER_GROUPSEP_ATTRIBUTE
See Also:
Constant Field Values

NUMBER_FRACTION_DIGITS

public static final java.lang.String NUMBER_FRACTION_DIGITS
See Also:
Constant Field Values

MINVALUE_ATTRIBUTE

public static final java.lang.String MINVALUE_ATTRIBUTE
See Also:
Constant Field Values

MAXVALUE_ATTRIBUTE

public static final java.lang.String MAXVALUE_ATTRIBUTE
See Also:
Constant Field Values

CURRENCY_CODE_ATTRIBUTE

public static final java.lang.String CURRENCY_CODE_ATTRIBUTE
See Also:
Constant Field Values

FILE_DATA_COLUMN_ATTRIBUTE

public static final java.lang.String FILE_DATA_COLUMN_ATTRIBUTE
See Also:
Constant Field Values

NO_VALUE

public static final java.lang.Object NO_VALUE
The NO_VALUE constant is used as a return value from getFieldValue to indicate that the value for this column has not been provided


NULL_VALUE

public static final java.lang.Object NULL_VALUE
The NULL_VALUE constant is used as a return value from getFieldValue to indicate that the field value was provided with the request, but is empty so that the underlying database field should be set to null

Constructor Detail

InputControl

public InputControl()
Method Detail

useLabelId

public boolean useLabelId()
This method determines whether an id should be put on the input label If true than the renderInput function must add an id attribute to an input field The value of the id is supplied with the ControlInfo

Returns:
true if an id should be set on the label or false otherwise

getFieldValue

public java.lang.Object getFieldValue(java.lang.String name,
                                      RequestParamProvider request,
                                      java.util.Locale locale,
                                      org.apache.empire.data.Column column)
this method parses and validates the value of a particular column from the request

Parameters:
name - the name under which the param is stored on the request
request - used to access the request Parameters
column - the column for which the value should be
Returns:
the parsed and validated record field value or a FieldValueError if an error occurred

renderText

public void renderText(HtmlWriter writer,
                       InputControl.ValueInfo vi)
this method renders a record value read only this can be either in a read only form or a table

Parameters:
writer - the HtmlWriter for html write-out
vi - Object holding the value and meta-information about the value

renderInput

public abstract void renderInput(HtmlWriter writer,
                                 InputControl.ControlInfo ci)
this method renders a record value for input

Parameters:
writer - the HtmlWriter for html write-out
ci - Object holding the value and meta-information about the value and the control