ValueHost implementation that does not handle validation. (See InputValueHost and PropertyValueHost for validation) Use ValueHostConfig.valueHostType = "Static" for the ValidationManager to use this class.

Generally create these when:

  • Expose a value from the UI that doesn't need validation, but its value is used by other validators.
  • Expose a global value - something not part of the form - that can be used by your Conditions, such as the current Country code used to select the right regular expression for postal codes, phone numbers, etc.
  • Store all of the remaining members of your Model. Makes ValidationManager's ValueHosts your ---Single Source of Truth (SSOT)--- for that Model. When working with a Model, you will need to write code that transfers the Model's property values into the UI elements. Since ValidationManager needs those same values, you can build your input fields/elements to get their value from ValidationManager and upon change, provide the new values back.

Hierarchy (view full)

Implements

Constructors

Accessors

  • get isChanged(): boolean
  • Determines how the validation system sees the Value in terms of editing. When true, it was changed. When false, it was not. The setValue()/setInputValue()/setValues() functions are the only ones to change this flag. They all set it to true automatically except set it to false when the option.Reset is true. The ValueHost.validate() function may skip validation of an InputValueHost when IsChanged is false, depending on the options for validate. For example, calling validate immediately after loading up the form, you want to avoid showing Category=Require validators. Those should appear only if the user edits, or when the user attempts to submit.

    Returns boolean

Methods

  • System consumer assigns the native value to make it available to most Conditions during validation.

    Parameters

    • value: any

      Can be undefined to indicate the value could not be resolved from the input field/element's value, such as inability to convert a string to a date. All other values, including null and the empty string, are considered real data. When undefined, IsChanged will still be changed to true unless options.Reset = true.

    • Optional options: SetValueOptions

      validate - Invoke validation after setting the value. Reset - Clears validation (except when validate=true) and sets IsChanged to false. ConversionErrorTokenValue - When setting the value to undefined, it means there was an error converting. Provide a string here that is a UI friendly error message. It will appear in the Category=Require validator within the {ConversionError} token. SkipValueChangedCallback - Skips the automatic callback setup with the OnValueChanged property.

    Returns void

  • Consuming system calls this when it attempts to resolve the input field/element value but cannot. It identifies that the native value is undefined. Note this does not reset IsChanged to false without explicitly specifying options.Reset = true;

    Parameters

    • Optional options: SetValueOptions

      validate - Invoke validation after setting the value. Reset - Clears validation (except when validate=true) and sets IsChanged to false. ConversionErrorTokenValue - When setting the value to undefined, it means there was an error converting. Provide a string here that is a UI friendly error message. It will appear in the Category=Require validator within the {ConversionError} token.

    Returns void

  • Determines if the ValueHost is enabled for user interaction. It is enabled unless you explicilty set it to false using ValueHostConfig.initialEnabled : false, setup the EnablerCondition which determines when it is enabled, or the ValueHost's own setEnabled() function.

    When disabled, the data values of the ValueHost do not get changed by setValue() and related functions. However, those functions offer the overrideDisabled option to force the change.

    When disabled and the ValueHost have validators, all validation is disabled and its ValidationStatus reports ValidationState.Disabled.

    Returns boolean

  • Sets the enabled state of the ValueHost. When false, the ValueHost is disabled and setValue() and related functions will not change the value. However, they offer the overrideDisabled option to force the change. When disabled and the ValueHost has validators, all validation is disabled and its ValidationStatus reports ValidationState.Disabled.

    This value is part of the ValueHost's InstanceState, not the Config, although the ValueHostConfig.initialEnabled is used when it is not set in the state.

    Parameters

    • enabled: boolean

    Returns void

Generated using TypeDoc v0.25.12