org.apache.tapestry5.corelib.components
Class BeanEditForm

java.lang.Object
  extended by org.apache.tapestry5.corelib.components.BeanEditForm
All Implemented Interfaces:
ClientElement, FormValidationControl

@SupportsInformalParameters
public class BeanEditForm
extends Object
implements ClientElement, FormValidationControl

A component that creates an entire form editing the properties of a particular bean. Inspired by Trails and BeanForm (both for Tapestry 4). Generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.

You may add block parameters to the component; when the name matches (case insensitive) the name of a property, then the corresponding Block is renderered, rather than any of the built in property editor blocks. This allows you to override specific properties with your own customized UI, for cases where the default UI is insufficient, or no built-in editor type is appropriate.

See Also:
BeanModel, BeanModelSource, PropertyEditor, DataType

Constructor Summary
BeanEditForm()
           
 
Method Summary
 void clearErrors()
          Invokes ValidationTracker.clear().
 String getClientId()
          Returns the client id of the embedded form.
 boolean getHasErrors()
          Returns true if the form's ValidationTracker contains any errors.
 boolean isValid()
          Returns true if the form's ValidationTracker does not contain any errors.
 void recordError(Field field, String errorMessage)
          A convienience for invoking ValidationTracker.recordError(Field, String).
 void recordError(String errorMessage)
          A convienience for invoking ValidationTracker.recordError(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanEditForm

public BeanEditForm()
Method Detail

getClientId

public String getClientId()
Returns the client id of the embedded form.

Specified by:
getClientId in interface ClientElement

clearErrors

public void clearErrors()
Description copied from interface: FormValidationControl
Invokes ValidationTracker.clear().

Specified by:
clearErrors in interface FormValidationControl

getHasErrors

public boolean getHasErrors()
Description copied from interface: FormValidationControl
Returns true if the form's ValidationTracker contains any errors.

Specified by:
getHasErrors in interface FormValidationControl

isValid

public boolean isValid()
Description copied from interface: FormValidationControl
Returns true if the form's ValidationTracker does not contain any errors.

Specified by:
isValid in interface FormValidationControl

recordError

public void recordError(Field field,
                        String errorMessage)
Description copied from interface: FormValidationControl
A convienience for invoking ValidationTracker.recordError(Field, String).

Specified by:
recordError in interface FormValidationControl

recordError

public void recordError(String errorMessage)
Description copied from interface: FormValidationControl
A convienience for invoking ValidationTracker.recordError(String).

Specified by:
recordError in interface FormValidationControl


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.