SAS logoSAS® Mobile Investigator API
    Preparing search index...

    Interface SmiMultiValueControlFormApi

    An API of methods and properties for forms on a multiple value control.

    interface SmiMultiValueControlFormApi {
        addValidator(
            validator: () => { [errorName: string]: string } | null,
            typeAttribute?: string,
        ): () => void;
        getErrors(typeAttribute?: string): { [error: string]: string } | null;
        getValidationMessageId(): string | undefined;
        isDirty(typeAttribute?: string): boolean;
        isInvalid(typeAttribute?: string): boolean;
        isTouched(typeAttribute?: string): boolean;
        isValid(typeAttribute?: string): boolean;
        markAllAsTouched(): void;
        markAsDirty(typeAttribute?: string): void;
        markAsPristine(typeAttribute?: string): void;
        markAsTouched(typeAttribute?: string): void;
        onShowInvalidChange(
            callback: (showInvalid: boolean) => void,
            typeAttribute?: string,
        ): () => void;
        onValidityChange(
            callback: (valid: boolean) => void,
            typeAttribute?: string,
        ): () => void;
        reset(typeAttribute?: string): void;
        setErrors(
            errors: { [error: string]: string } | null,
            typeAttribute?: string,
        ): void;
        showInvalid(typeAttribute?: string): boolean;
    }
    Index

    Methods

    • Adds a validator function to the control. Returns an error object, or null if there are no errors. to the control.

      Parameters

      • validator: () => { [errorName: string]: string } | null

        The validator function to add.

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns () => void

      A function that removes the validator.

    • Returns all errors for the control.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns { [error: string]: string } | null

      An object containing the errors or null.

    • Gives the ID of the element that is showing a validation message for the control. Returns the ID for the element that is showing a validation message for the control. Returns undefined if there is no message shown.

      Returns string | undefined

      The id of the element that is showing a validation message for the control or returns undefined if there is no message being shown.

    • Returns whether the control is dirty. A control is dirty after the user has changed the value of the control.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns boolean

      A boolean value describing if the control is dirty.

    • Gives whether the control is invalid.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns boolean

      A boolean value describing if the control is invalid.

    • Returns whether the control is touched. A control is touched after the user has triggered a blur event on it.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns boolean

      A boolean value describing if the control has been touched.

    • Returns whether the control is valid.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns boolean

      A boolean value describing if the control is valid.

    • Marks the control and all its descendant controls as touched.

      Returns void

    • Marks the control as dirty.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns void

    • Marks the control as pristine.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns void

    • Marks the control as touched.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns void

    • Runs a callback when the the control's show invalid state changes.

      Parameters

      • callback: (showInvalid: boolean) => void
      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns () => void

      A function that removes the callback.

    • Runs a callback when the the control's validity changes.

      Parameters

      • callback: (valid: boolean) => void

        A callback that is invoked with the valid state.

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns () => void

      A function that removes the callback.

    • Resets the form control, marking it pristine and untouched.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns void

    • Sets the given error on the control.

      Parameters

      • errors: { [error: string]: string } | null

        The errors object.

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns void

    • Returns whether the control should show itself as being invalid.

      Parameters

      • OptionaltypeAttribute: string

        The type attribute with which the form control is associated.

      Returns boolean

      A boolean value indicating whether the control should show itself as being invalid.