net.sf.springlayout.web.layout
Interface Form

All Known Subinterfaces:
PanelForm
All Known Implementing Classes:
LayoutForm, LayoutPanelForm

public interface Form

Defines a single panel on a muli-panel page.

Author:
Rob Monie

Method Summary
 java.lang.String getControllerBeanName()
          Retrieves the controllerBeanName for this LayoutForm.
 java.util.Map getErrors(org.springframework.validation.Errors errors)
          Gets errors for the current panel by retrieving all errors relating to fields defined for this panel from the errors object.
 FieldDefinition getFieldDefinition(java.lang.String path)
          Gets a field definition from the fieldDefinitions map by the field path passed in.
 java.util.Map getFieldDefinitions()
           
 java.lang.String getFormAction()
          Gets the url for this panel
 java.lang.String getFormName()
           
 boolean hasErrors(org.springframework.validation.Errors errors)
          Checks the current panel for errors
 void setControllerBeanName(java.lang.String controllerBeanName)
          Sets the controllerBeanName for this LayoutForm.
 void setFieldDefinitions(java.util.Map fields)
           
 void setFormAction(java.lang.String url)
          Sets the url for this panel.
 void setFormName(java.lang.String panelFormName)
           
 void validate(javax.servlet.http.HttpServletRequest request, java.lang.Object obj, org.springframework.validation.Errors errors)
          Calls validate on all validation rules associated with the fieldDefinitions for this panel.
 

Method Detail

getFieldDefinitions

java.util.Map getFieldDefinitions()
Returns:
Returns the fields.

setFieldDefinitions

void setFieldDefinitions(java.util.Map fields)
Parameters:
fields - The fields to set.

getFieldDefinition

FieldDefinition getFieldDefinition(java.lang.String path)
Gets a field definition from the fieldDefinitions map by the field path passed in. Indexed fields with paths that traverse collections such as commandObject.list[2].fieldName match against a non-indexed key in a format such as commandObject.list.fieldName. This way single field definition is used for all elements within a collection resulting in a fully dynamic solution.

Parameters:
path - the path of the property in the object graph
Returns:
a field definition for the path

validate

void validate(javax.servlet.http.HttpServletRequest request,
              java.lang.Object obj,
              org.springframework.validation.Errors errors)
Calls validate on all validation rules associated with the fieldDefinitions for this panel.

Parameters:
request - the current HttpServletRequest
obj - the current command object to be validated
errors - the current errors for this request

getErrors

java.util.Map getErrors(org.springframework.validation.Errors errors)
Gets errors for the current panel by retrieving all errors relating to fields defined for this panel from the errors object.

Parameters:
errors - the current page errors
Returns:
a map of errors for this panel

hasErrors

boolean hasErrors(org.springframework.validation.Errors errors)
Checks the current panel for errors

Parameters:
errors - the current page errors
Returns:
true if errors present for this panel group

getFormName

java.lang.String getFormName()
Returns:
Returns the formName.

setFormName

void setFormName(java.lang.String panelFormName)
Parameters:
panelName - The panelName to set.

getFormAction

java.lang.String getFormAction()
Gets the url for this panel

Returns:

setFormAction

void setFormAction(java.lang.String url)
Sets the url for this panel. The url should match that used to map to the controller used by this panel.

Parameters:
url -

getControllerBeanName

java.lang.String getControllerBeanName()
Retrieves the controllerBeanName for this LayoutForm.

Returns:
Returns the controllerBeanName for this LayoutForm.

setControllerBeanName

void setControllerBeanName(java.lang.String controllerBeanName)
Sets the controllerBeanName for this LayoutForm.

Parameters:
controllerBeanName - Sets the controllerBeanName for this LayoutForm.


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