Class ValidateEqual

All Implemented Interfaces:
PartialStateHolder, StateHolder, TransientStateHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder, EventListener, MultiFieldValidator

public class ValidateEqual extends ValidateMultipleFields

The <o:validateEqual> validates if ALL of the given UIInput components have the same value.

The default message is

{0}: Please fill out the same value for all of those fields

For general usage instructions, refer ValidateMultipleFields documentation.

Author:
Bauke Scholtz
See Also:
  • Field Details

    • COMPONENT_TYPE

      public static final String COMPONENT_TYPE
      The component type, which is "org.omnifaces.component.validator.ValidateEqual".
      See Also:
  • Constructor Details

    • ValidateEqual

      public ValidateEqual()
  • Method Details

    • validateValues

      public boolean validateValues(FacesContext context, List<UIInput> inputs, List<Object> values)
      Validate if all values are equal.
      Parameters:
      context - The faces context to work with.
      inputs - The input components whose values are to be validated.
      values - The values of the input components to be validated, in the same order as the components.
      Returns:
      true if validation is successful, otherwise false (and thus show the message).