org.richfaces.component.behavior

## Class ClientValidatorImpl

- java.lang.Object
- - javax.faces.component.behavior.BehaviorBase
  - - javax.faces.component.behavior.ClientBehaviorBase
    - - org.richfaces.component.behavior.ClientBehavior
      - - org.ajax4jsf.component.behavior.AjaxBehavior
        - - org.richfaces.component.behavior.ClientValidatorImpl

- All Implemented Interfaces:
    javax.faces.component.behavior.Behavior, javax.faces.component.behavior.ClientBehavior, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, AjaxClientBehavior, AjaxActivatorProps, AjaxProps, ImmediateProps, ClientValidatorBehavior

      public class ClientValidatorImpl
      extends AjaxBehavior
      implements ClientValidatorBehavior, ImmediateProps

  The <rich:validator> behavior adds client-side validation to a form input control based on registered server-side validators. It provides this validation without the need to reproduce the server-side annotations.

  The <rich:validator> behavior triggers all client validator annotations listed in the relevant managed bean.

  Author:
    asmirnov@exadel.com

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `ClientValidatorImpl.Properties`

  - ### Field Summary

    - ### Fields inherited from class org.ajax4jsf.component.behavior.AjaxBehavior

      `BEHAVIOR_ID`

    - ### Fields inherited from interface org.richfaces.component.behavior.ClientValidatorBehavior

      `BEHAVIOR_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientValidatorImpl()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `broadcast(javax.faces.event.BehaviorEvent event)`
    `protected boolean` | `findMessages(javax.faces.component.UIComponent parent, javax.faces.component.UIComponent component, Set<javax.faces.component.UIComponent> messages, boolean found, Object id)` Recursive search messages for the parent component.
    `protected void` | `findRichMessages(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String id, Set<javax.faces.component.UIComponent> messages)` Find all instances of the `org.richfaces.component.UIRichMessages` and update list of the rendered messages.
    `String` | `getAjaxScript(javax.faces.component.behavior.ClientBehaviorContext context)` Get JavaScript code for AJAX request.
    `ConverterDescriptor` | `getConverter(javax.faces.component.behavior.ClientBehaviorContext context)` Look up for converter associated with target UIInput
    `Collection<String>` | `getExecute()` Ids of components that will participate in the "execute" portion of the Request Processing Lifecycle.
    `Class<?>[]` | `getGroups()` Returns array of classes that represents JSR-303 validation groups.
    `Set<javax.faces.component.UIComponent>` | `getMessages(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)`
    `String` | `getOninvalid()`
    `String` | `getOnvalid()`
    `Collection<String>` | `getRender()` Ids of components that will participate in the "render" portion of the Request Processing Lifecycle.
    `protected javax.faces.render.ClientBehaviorRenderer` | `getRenderer(javax.faces.context.FacesContext context, String rendererType)` Look up for `ClientBehaviorRenderer` instence
    `String` | `getRendererType()`
    `String` | `getScript(javax.faces.component.behavior.ClientBehaviorContext behaviorContext)`
    `Collection<ValidatorDescriptor>` | `getValidators(javax.faces.component.behavior.ClientBehaviorContext context)`
    `boolean` | `isBypassUpdates()` If "true", after process validations phase it skips updates of model beans on a force render response.
    `boolean` | `isImmediateSet()`
    `boolean` | `isLimitRender()` If "true", render only those ids specified in the "render" attribute, forgoing the render of the auto-rendered panels
    `void` | `restoreState(javax.faces.context.FacesContext context, Object state)`
    `Object` | `saveState(javax.faces.context.FacesContext context)`
    `void` | `setGroups(Class<?>... groups)`
    `void` | `setLiteralAttribute(String name, Object value)`
    `void` | `setOninvalid(String value)`
    `void` | `setOnvalid(String value)`

    - ### Methods inherited from class org.ajax4jsf.component.behavior.AjaxBehavior

      `addAjaxBehaviorListener, getData, getEvent, getHints, getListener, getOnbeforedomupdate, getOnbeforesubmit, getOnbegin, getOncomplete, getOnerror, getQueueId, getStatus, isDisabled, isImmediate, isResetValues, removeAjaxBehaviorListener, setBypassUpdates, setData, setDisabled, setEvent, setExecute, setImmediate, setLimitRender, setListener, setOnbeforedomupdate, setOnbeforesubmit, setOnbegin, setOncomplete, setOnerror, setQueueId, setRender, setResetValues, setStatus`

    - ### Methods inherited from class org.richfaces.component.behavior.ClientBehavior

      `compare, getFacesContext, getStateHelper, getValueExpression, setLiteralValue, setValueExpression`

    - ### Methods inherited from class javax.faces.component.behavior.ClientBehaviorBase

      `decode, getRenderer`

    - ### Methods inherited from class javax.faces.component.behavior.BehaviorBase

      `addBehaviorListener, clearInitialState, initialStateMarked, isTransient, markInitialState, removeBehaviorListener, setTransient`

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

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

    - ### Methods inherited from interface org.richfaces.component.behavior.ClientValidatorBehavior

      `isDisabled, isImmediate`

    - ### Methods inherited from interface javax.faces.component.behavior.ClientBehavior

      `decode, getHints`

    - ### Methods inherited from interface org.richfaces.component.attribute.ImmediateProps

      `isImmediate`

- - ### Constructor Detail

    - #### ClientValidatorImpl

          public ClientValidatorImpl()

  - ### Method Detail

    - #### getScript

          public String getScript(javax.faces.component.behavior.ClientBehaviorContext behaviorContext)

      Specified by:
        `getScript` in interface `javax.faces.component.behavior.ClientBehavior`
      Overrides:
        `getScript` in class `javax.faces.component.behavior.ClientBehaviorBase`

    - #### getRendererType

          public String getRendererType()

      Overrides:
        `getRendererType` in class `AjaxBehavior`

    - #### broadcast

          public void broadcast(javax.faces.event.BehaviorEvent event)
                         throws javax.faces.event.AbortProcessingException

      Specified by:
        `broadcast` in interface `javax.faces.component.behavior.Behavior`
      Overrides:
        `broadcast` in class `AjaxBehavior`
      Throws:
        `javax.faces.event.AbortProcessingException`

    - #### setLiteralAttribute

          public void setLiteralAttribute(String name,
                                 Object value)

      Overrides:
        `setLiteralAttribute` in class `AjaxBehavior`

    - #### getMessages

          public Set<javax.faces.component.UIComponent> getMessages(javax.faces.context.FacesContext context,
                                                           javax.faces.component.UIComponent component)

    - #### findRichMessages

          protected void findRichMessages(javax.faces.context.FacesContext context,
                              javax.faces.component.UIComponent component,
                              String id,
                              Set<javax.faces.component.UIComponent> messages)

      Find all instances of the `org.richfaces.component.UIRichMessages` and update list of the rendered messages.
      Parameters:
        `context` -
        `component` -
        `messages` -

    - #### findMessages

          protected boolean findMessages(javax.faces.component.UIComponent parent,
                             javax.faces.component.UIComponent component,
                             Set<javax.faces.component.UIComponent> messages,
                             boolean found,
                             Object id)

      Recursive search messages for the parent component.
      Parameters:
        `parent` -
        `component` -
        `messages` -
        `id` -

    - #### getRenderer

          protected javax.faces.render.ClientBehaviorRenderer getRenderer(javax.faces.context.FacesContext context,
                                                              String rendererType)

      Look up for `ClientBehaviorRenderer` instence

      Parameters:
        `context` - current JSF context
        `rendererType` - desired renderer type
      Returns:
        renderer instance
      Throws:
        `{@link` - FacesException} if renderer can not be found

    - #### getConverter

          public ConverterDescriptor getConverter(javax.faces.component.behavior.ClientBehaviorContext context)
                                           throws ConverterNotFoundException

      Description copied from interface: `ClientValidatorBehavior`

      Look up for converter associated with target UIInput

      Specified by:
        `getConverter` in interface `ClientValidatorBehavior`
      Returns:
        `Converter` instance or null if conversion not required.
      Throws:
        `ConverterNotFoundException`

    - #### getValidators

          public Collection<ValidatorDescriptor> getValidators(javax.faces.component.behavior.ClientBehaviorContext context)

      Description copied from interface: `ClientValidatorBehavior`

      Specified by:
        `getValidators` in interface `ClientValidatorBehavior`

    - #### getGroups

          public Class<?>[] getGroups()

      Description copied from interface: `ClientValidatorBehavior`

      Returns array of classes that represents JSR-303 validation groups.

      Specified by:
        `getGroups` in interface `ClientValidatorBehavior`

    - #### setGroups

          public void setGroups(Class<?>... groups)

      Specified by:
        `setGroups` in interface `ClientValidatorBehavior`

    - #### getAjaxScript

          public String getAjaxScript(javax.faces.component.behavior.ClientBehaviorContext context)

      Description copied from interface: `ClientValidatorBehavior`

      Get JavaScript code for AJAX request.

      Specified by:
        `getAjaxScript` in interface `ClientValidatorBehavior`

    - #### saveState

          public Object saveState(javax.faces.context.FacesContext context)

      Specified by:
        `saveState` in interface `javax.faces.component.StateHolder`
      Overrides:
        `saveState` in class `AjaxBehavior`

    - #### restoreState

          public void restoreState(javax.faces.context.FacesContext context,
                          Object state)

      Specified by:
        `restoreState` in interface `javax.faces.component.StateHolder`
      Overrides:
        `restoreState` in class `AjaxBehavior`

    - #### isImmediateSet

          public boolean isImmediateSet()

      Specified by:
        `isImmediateSet` in interface `ClientValidatorBehavior`

    - #### isLimitRender

          public boolean isLimitRender()

      Description copied from class: `AjaxBehavior`
      If "true", render only those ids specified in the "render" attribute, forgoing the render of the auto-rendered panels
      Specified by:
        `isLimitRender` in interface `AjaxClientBehavior`
      Specified by:
        `isLimitRender` in interface `AjaxActivatorProps`
      Overrides:
        `isLimitRender` in class `AjaxBehavior`

    - #### isBypassUpdates

          public boolean isBypassUpdates()

      Description copied from class: `AjaxBehavior`
      If "true", after process validations phase it skips updates of model beans on a force render response. It can be used for validating components input
      Overrides:
        `isBypassUpdates` in class `AjaxBehavior`

    - #### getExecute

          public Collection<String> getExecute()

      Description copied from class: `AjaxBehavior`
      Ids of components that will participate in the "execute" portion of the Request Processing Lifecycle. Can be a single id, a space or comma separated list of Id's, or an EL Expression evaluating to an array or Collection. Any of the keywords "@this", "@form", "@all", "@none", "@region" may be specified in the identifier list. Some components make use of additional keywords
      Specified by:
        `getExecute` in interface `AjaxClientBehavior`
      Specified by:
        `getExecute` in interface `AjaxProps`
      Overrides:
        `getExecute` in class `AjaxBehavior`

    - #### getRender

          public Collection<String> getRender()

      Description copied from class: `AjaxBehavior`
      Ids of components that will participate in the "render" portion of the Request Processing Lifecycle. Can be a single id, a space or comma separated list of Id's, or an EL Expression evaluating to an array or Collection. Any of the keywords "@this", "@form", "@all", "@none", "@region" may be specified in the identifier list. Some components make use of additional keywords
      Specified by:
        `getRender` in interface `AjaxClientBehavior`
      Specified by:
        `getRender` in interface `AjaxActivatorProps`
      Overrides:
        `getRender` in class `AjaxBehavior`

    - #### getOnvalid

          public String getOnvalid()

      Specified by:
        `getOnvalid` in interface `ClientValidatorBehavior`

    - #### setOnvalid

          public void setOnvalid(String value)

    - #### getOninvalid

          public String getOninvalid()

      Specified by:
        `getOninvalid` in interface `ClientValidatorBehavior`

    - #### setOninvalid

          public void setOninvalid(String value)

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.