org.apache.tapestry.contrib.valid
Class ValidatingTextField

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.form.AbstractFormComponent
              extended by org.apache.tapestry.valid.ValidField
                  extended by org.apache.tapestry.contrib.valid.ValidatingTextField
All Implemented Interfaces:
Locatable, LocationHolder, org.apache.tapestry.form.IFormComponent, org.apache.tapestry.IComponent, org.apache.tapestry.IDirectEvent, org.apache.tapestry.IRender

public abstract class ValidatingTextField
extends org.apache.tapestry.valid.ValidField

Backwards compatible version of the 1.0.7 ValidatingTextField component.

Parameter Type Read / Write Required Default Description
text java.lang.String R / W yes   The text inside the text field.

When the form is submitted, the binding is only updated if the value is valid.

minimumLength int R no 0 The minimum length (number of characters read) for the field. The value provided in the request is trimmed of leading and trailing whitespace.

If a field is not required and no value is given, then minimumLength is ignored. Minimum length only applies if some non-null value is given.

required boolean R no false If true, then a non-null value must be provided. A value consisting only of whitespace is considered null.
displayName String R yes   A textual name for the field that is used when formulating error messages.

May not have a body. May have informal parameters.

Since:
1.0.8
Author:
Howard Lewis Ship
See Also:
ValidField

Field Summary
 
Fields inherited from class org.apache.tapestry.AbstractComponent
_clientId
 
Constructor Summary
ValidatingTextField()
           
 
Method Summary
abstract  int getMinimumLength()
           
abstract  String getText()
           
 org.apache.tapestry.valid.IValidator getValidator()
          Overrides ValidField.getValidator()to construct a validator on the fly.
 Object getValue()
           
abstract  boolean isRequired()
           
abstract  void setText(String value)
           
 void setValue(Object value)
           
 
Methods inherited from class org.apache.tapestry.valid.ValidField
getDisplayName, isDisabled, isHidden, readValue, renderFormComponent, rewindFormComponent, updateValue
 
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent
getCanTakeFocus, getForm, getIdParameter, getName, getRenderBodyOnRewind, renderComponent, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, renderIdAttribute, setClientId, setForm, setName, setName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, isStateful, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString, triggerEvent
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.form.IFormComponent
getClientId
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

ValidatingTextField

public ValidatingTextField()
Method Detail

getMinimumLength

public abstract int getMinimumLength()

isRequired

public abstract boolean isRequired()
Specified by:
isRequired in interface org.apache.tapestry.form.IFormComponent
Overrides:
isRequired in class org.apache.tapestry.form.AbstractFormComponent

getText

public abstract String getText()

setText

public abstract void setText(String value)

getValue

public Object getValue()
Specified by:
getValue in class org.apache.tapestry.valid.ValidField

setValue

public void setValue(Object value)
Specified by:
setValue in class org.apache.tapestry.valid.ValidField

getValidator

public org.apache.tapestry.valid.IValidator getValidator()
Overrides ValidField.getValidator()to construct a validator on the fly.

Specified by:
getValidator in class org.apache.tapestry.valid.ValidField


Copyright © 2006 Apache Software Foundation. All Rights Reserved.