Class UniqueDatatableDTOName

  • All Implemented Interfaces:
    Serializable, EventListener, javax.faces.validator.Validator

    @ApplicationScoped
    public class UniqueDatatableDTOName
    extends AUniqueBeanStringFieldValidator<DatatableDTO>
    implements javax.faces.validator.Validator, Serializable
    Validator for the uniqueness of a datatable name within its scope (a project). To use this validator, you must add a "scope" attribute to the input component, which holds the ID of the project being validated. E.g.:
     <h:inputText value="#{bean.name}" validator="uniqueDatatableName">
       <f:attribute name="scope" value="#{bean.projectId}" />
     </h:inputText>
     
    Since:
    8.6.0
    See Also:
    Serialized Form
    • Constructor Detail

      • UniqueDatatableDTOName

        public UniqueDatatableDTOName()
    • Method Detail

      • hasDuplicates

        protected boolean hasDuplicates​(DatatableDTO datatable,
                                        String name,
                                        javax.faces.context.FacesContext context,
                                        javax.faces.component.UIComponent component)
        Description copied from class: AUniqueBeanFieldValidator
        Checks if any duplicates exists for the given bean with the given field value.
        Overrides:
        hasDuplicates in class AUniqueBeanFieldValidator<DatatableDTO,​String>
        Parameters:
        datatable - Bean to check for existing duplicates.
        name - Field value to check for duplicates.
        context - Current faces context.
        component - Component to validate.