org.apache.tapestry5.kaptcha.components

## Class KaptchaField

- java.lang.Object
- - org.apache.tapestry5.corelib.base.AbstractField
  - - org.apache.tapestry5.kaptcha.components.KaptchaField

- All Implemented Interfaces:
    ClientElement, Field

      @SupportsInformalParameters
       @Import(stylesheet="kaptcha.css")
      public class KaptchaField
      extends AbstractField

  Field paired with a `KaptchaImage` to ensure that the user has provided the correct value. Renders a class attribute of "form-control", which can be extended via the class informal attribute.
  Since:
    5.3

  Component Parameters
  Name | Type | Flags | Default | Default Prefix
  --- | --- | --- | --- | ---
  clientId | String |  |  | literal
  Used to explicitly set the client-side id of the element for this component. Normally this is not bound (or null) and org.apache.tapestry5.services.javascript.JavaScriptSupport#allocateClientId(org.apache.tapestry5.ComponentResources) is used to generate a unique client-id based on the component's id. In some cases, when creating client-side behaviors, it is useful to explicitly set a unique id for an element using this parameter. Certain values, such as "submit", "method", "reset", etc., will cause client-side conflicts and are not allowed; using such will cause a runtime exception.
  ensureClientIdUnique | boolean | Since 5.4 |  | prop
  A rarely used option that indicates that the actual client id should start with the clientId parameter (if non-null) but should still pass that Id through org.apache.tapestry5.services.javascript.JavaScriptSupport#allocateClientId(String) to generate the final id. An example of this are the components used inside a org.apache.tapestry5.corelib.components.BeanEditor which will specify a clientId (based on the property name) but still require that it be unique. Defaults to false.
  image | org.apache.tapestry5.kaptcha.components.KaptchaImage | Required |  | component
  The image output for this field. The image will display a distorted text string. The user must decode the distorted text and enter the same value.
  visible | boolean | Since 5.3 | symbol:tapestry.kaptcha-default-visible | prop
  Controls whether the field is rendered like a password field (false) or like a normal text field (true, the factory default).

- - ### Field Summary

    - ### Fields inherited from class org.apache.tapestry5.corelib.base.AbstractField

      `cssClass, decorator, defaultProvider, disabled, environment, fieldValidationSupport, formSupport, javaScriptSupport, label, request, resources, validationTracker`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KaptchaField()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isRequired()` Always required.
    `protected void` | `processSubmission(String controlName)` Method implemented by subclasses to actually do the work of processing the submission of the form.

    - ### Methods inherited from class org.apache.tapestry5.corelib.base.AbstractField

      `decorateInsideField, getClientId, getControlName, getLabel, isDisabled, putPropertyNameIntoBeanValidationContext, removePropertyNameFromBeanValidationContext, setDecorator, setFormSupport`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KaptchaField

          public KaptchaField()

  - ### Method Detail

    - #### isRequired

          public boolean isRequired()

      Always required.
      Specified by:
        `isRequired` in interface `Field`
      Overrides:
        `isRequired` in class `AbstractField`
      Returns:
        true if a non-blank value is required for the field

    - #### processSubmission

          protected void processSubmission(String controlName)

      Description copied from class: `AbstractField`
      Method implemented by subclasses to actually do the work of processing the submission of the form. The element's controlName property will already have been set. This method is only invoked if the field is not `disabled`.
      Specified by:
        `processSubmission` in class `AbstractField`
      Parameters:
        `controlName` - the control name of the rendered element (used to find the correct parameter in the request)

${project.version} - Copyright © 2003-2015 The Apache Software Foundation.