Class XGlobalValidationParams

    • Method Detail

      • getI18nValue

        public String getI18nValue​(String i18nKey)
        Specified by:
        getI18nValue in interface IXBaseValidationParams
        Parameters:
        i18nKey - I18n key for the localized message.
        Returns:
        The localized message for the given key, retrieved from the built-in resource bundle. Plugin resource bundles are not considered.
      • getClientId

        public long getClientId()
        Specified by:
        getClientId in interface IXBaseValidationParams
        Returns:
        The ID of the current client to which the form belongs.
      • getValues

        public List<String[]> getValues​(String key)
        Specified by:
        getValues in interface IXBaseValidationParams
        Parameters:
        key - Name of a form field.
        Returns:
        All values that were submitted for the given for the given form field name. The list contains multiple items when the form field is repeated; the array contains multiple items when the form field submitted multiple values (e.g. a select element with multiple set).
      • isValuesEmpty

        public boolean isValuesEmpty​(List<String[]> values)
        Specified by:
        isValuesEmpty in interface IXBaseValidationParams
        Parameters:
        values - List of values of a form field.
        Returns:
        true if the values are all empty, or false otherwise.
      • isShouldValidate

        public boolean isShouldValidate()
        Description copied from interface: IXBaseValidationParams
        Whether server-side validation should be performed. Server-validation may be disabled due to one of several reasons.

        For the form in general:

        • The form action does not require validation. When designing a form, the user can choose whether the form should be validated when a submit button is pressed. This returns true when a submit button was pressed that requires the form to be validated, and false.
        Additional reasons for particular form elements:
        • Server validation is disabled for the form element in the form designer.
        • The element is not rendered due to a state or user group condition.
        • The element is disabled due to a state or user group condition.
        • The element is hidden, e.g. due to a hidden-if condition.
        In general, no validation should be performed when this is false. However, there are some use cases when validation needs to be performed no matter the circumstances. In that case, this flag may be ignored.
        Specified by:
        isShouldValidate in interface IXBaseValidationParams
        Returns:
        Whether the form element should be validated.
      • isServerValidationRequiredBySubmitAction

        public boolean isServerValidationRequiredBySubmitAction()
        Description copied from interface: IXBaseValidationParams
        Gets whether the submit buttons that was used to submit the form requires server-side validation. For example, the submit button action submit+check requires validation, the action submit does not.
        Specified by:
        isServerValidationRequiredBySubmitAction in interface IXBaseValidationParams
        Returns:
        true if the submit button action requires server-side validation, false otherwise.