net.sf.springlayout.web.layout
Class OnPageFieldInstance

java.lang.Object
  extended by net.sf.springlayout.web.layout.OnPageFieldInstance

public class OnPageFieldInstance
extends java.lang.Object

This is an instance of an actual field that is rendered on a page. There may be multiple instances for the same fieldDefinition. Each with an indexed path to the actual location within the command object. Most times there will at least be a label and a field, both being separate OnPageFieldInstances. The OnPageFieldInstance contains details about a field, it's actual id within the form where it is to be rendered, and whether it is currently marked as a mandatory field. This class allows a form to render aggregated Javascript at the end of the form rendering process.

Author:
Adam Boas, Rob Monie Created on 19/05/2006

Constructor Summary
OnPageFieldInstance()
          default constructor
OnPageFieldInstance(java.lang.String fieldId, FieldDefinition fieldDefinition, PageAccessHolder pageAccessHolder, boolean grouped, int groupSize)
           
 
Method Summary
 void addExternalMandatoryRule(java.lang.String rule)
           
 boolean equals(java.lang.Object obj)
           
 java.util.List getExternalManadatoryRules()
          Retrieves the externalManadatoryRules for this OnPageFieldInstance.
 FieldDefinition getFieldDefinition()
          Retrieves the fieldDefinition for this OnPageFieldInstance.
 java.lang.String getFieldId()
          Retrieves the fieldId for this OnPageFieldInstance.
 boolean getHasErrors()
          Get the current error status for the field
 java.lang.String getJavascript(boolean isValidationMode, java.lang.Object command, java.lang.String formName)
           
 boolean getReadOnly()
          get the current field readonly property
 int hashCode()
           
 boolean isFailedMandatory(org.springframework.beans.BeanWrapper wrappedObject)
           
 boolean isFailedValidation(org.springframework.beans.BeanWrapper wrappedObject)
          Validates the field for mandatory'ness and valid data
 boolean isGrouped()
           
 boolean isMandatory(org.springframework.beans.BeanWrapper wrappedObject)
          is the current field status mandatory
 void setExternalManadatoryRules(java.util.List externalManadatoryRules)
          Sets the externalManadatoryRules for this OnPageFieldInstance.
 void setFieldDefinition(FieldDefinition fieldDefinition)
          Sets the fieldDefinition for this OnPageFieldInstance.
 void setFieldId(java.lang.String fieldId)
          Sets the fieldId for this OnPageFieldInstance.
 void setHasErrors(boolean hasErrors)
          set the current error status for the field
 void setReadOnly(boolean readOnly)
          set the current field readonly property
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OnPageFieldInstance

public OnPageFieldInstance()
default constructor


OnPageFieldInstance

public OnPageFieldInstance(java.lang.String fieldId,
                           FieldDefinition fieldDefinition,
                           PageAccessHolder pageAccessHolder,
                           boolean grouped,
                           int groupSize)
Parameters:
fieldId -
fieldDefinition -
currentlyMandatory -
Method Detail

getExternalManadatoryRules

public java.util.List getExternalManadatoryRules()
Retrieves the externalManadatoryRules for this OnPageFieldInstance.

Returns:
Returns the externalManadatoryRules for this OnPageFieldInstance.

setExternalManadatoryRules

public void setExternalManadatoryRules(java.util.List externalManadatoryRules)
Sets the externalManadatoryRules for this OnPageFieldInstance.

Parameters:
externalManadatoryRules - Sets the externalManadatoryRules for this OnPageFieldInstance.

addExternalMandatoryRule

public void addExternalMandatoryRule(java.lang.String rule)
Parameters:
rule -

getFieldDefinition

public FieldDefinition getFieldDefinition()
Retrieves the fieldDefinition for this OnPageFieldInstance.

Returns:
Returns the fieldDefinition for this OnPageFieldInstance.

setFieldDefinition

public void setFieldDefinition(FieldDefinition fieldDefinition)
Sets the fieldDefinition for this OnPageFieldInstance.

Parameters:
fieldDefinition - Sets the fieldDefinition for this OnPageFieldInstance.

getFieldId

public java.lang.String getFieldId()
Retrieves the fieldId for this OnPageFieldInstance.

Returns:
Returns the fieldId for this OnPageFieldInstance.

setFieldId

public void setFieldId(java.lang.String fieldId)
Sets the fieldId for this OnPageFieldInstance.

Parameters:
fieldId - Sets the fieldId for this OnPageFieldInstance.

isMandatory

public boolean isMandatory(org.springframework.beans.BeanWrapper wrappedObject)
is the current field status mandatory

Returns:

getReadOnly

public boolean getReadOnly()
get the current field readonly property

Returns:

setReadOnly

public void setReadOnly(boolean readOnly)
set the current field readonly property

Parameters:
readOnly -

getHasErrors

public boolean getHasErrors()
Get the current error status for the field

Returns:

setHasErrors

public void setHasErrors(boolean hasErrors)
set the current error status for the field

Parameters:
hasErrors -

getJavascript

public java.lang.String getJavascript(boolean isValidationMode,
                                      java.lang.Object command,
                                      java.lang.String formName)

isFailedMandatory

public boolean isFailedMandatory(org.springframework.beans.BeanWrapper wrappedObject)
Returns:

isFailedValidation

public boolean isFailedValidation(org.springframework.beans.BeanWrapper wrappedObject)
Validates the field for mandatory'ness and valid data

Parameters:
wrappedObject -
Returns:

isGrouped

public boolean isGrouped()
Returns:
the isGrouped

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005-2007 Spring Layout Team. All Rights Reserved.