Nutrient Web SDK
    Preparing search index...

    Class FormFieldValue

    Record representing a form field value.

    To retrieve a list of all form field values, use Instance#getFormFieldValues.

    Please see our forms guide article to learn more about forms and for examples on how to set form field values.

    Setting a form field value.

    const formFieldValue = new FormFieldValue({
    name: 'Form field name',
    value: 'Form field value'
    });
    instance.update(formFieldValue);

    Hierarchy

    Index

    Constructors

    • Parameters

      • Optionalargs: { [key: string]: any }

      Returns NutrientViewer.FormFieldValue

    Properties

    name: string

    Unique name of the form field (often referred to as fully qualified name). This name is used to link form field value to a FormFields.FormField.

    optionIndexes?: NutrientViewer.Immutable.List<number>

    Radio buttons and checkboxes can have multiple widgets with the same form value associated, but can be selected independently. optionIndexes contains the value indexes that should be actually set.

    If set, the value field doesn't get used, and the widget found at the corresponding indexes in the form field's annotationIds property are checked.

    If set on fields other than radio buttons or checkboxes, setting the form value will fail.

    value: null | string | NutrientViewer.Immutable.List<string>

    The value of the form field.

    defaultValues: IObject = ...

    Methods

    • Returns IterableIterator<
          [
              "name"
              | "isFitting"
              | "value"
              | "optionIndexes",

                  | undefined
                  | null
                  | string
                  | number
                  | boolean
                  | NutrientViewer.Immutable.List<string>
                  | NutrientViewer.Immutable.List<number>,
          ],
      >

    • Returns this

      Map#asImmutable

    • Returns this

      Map#asMutable

    • Returns a new instance of this Record type with all values set to their default values.

      Returns this

    • Returns a new instance of this Record type with the value for the specific key set to its default value.

      Type Parameters

      • K extends "name" | "isFitting" | "value" | "optionIndexes"

      Parameters

      • key: K

      Returns this

      remove

    • Parameters

      Returns this

      removeIn

    • Parameters

      • other: any

      Returns boolean

    • Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.

      If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.

      Type Parameters

      • K extends "name" | "isFitting" | "value" | "optionIndexes"

      Parameters

      • key: K
      • OptionalnotSetValue: any

      Returns {
          isFitting?: boolean;
          name?: string;
          optionIndexes?: NutrientViewer.Immutable.List<number>;
          value?: null | string | number | NutrientViewer.Immutable.List<string>;
      }[K]

    • Type Parameters

      • T

      Parameters

      • key: string
      • notSetValue: T

      Returns T

    • Parameters

      Returns any

    • Parameters

      • key: string

      Returns key is "name" | "isFitting" | "value" | "optionIndexes"

    • Returns number

    • Parameters

      Returns boolean

    • Parameters

      • ...collections: (
            | Iterable<[string, any]>
            | Partial<
                {
                    isFitting?: boolean;
                    name?: string;
                    optionIndexes?: NutrientViewer.Immutable.List<number>;
                    value?: null | string | number | NutrientViewer.Immutable.List<string>;
                },
            >
        )[]

      Returns this

    • Parameters

      • ...collections: (
            | Iterable<[string, any]>
            | Partial<
                {
                    isFitting?: boolean;
                    name?: string;
                    optionIndexes?: NutrientViewer.Immutable.List<number>;
                    value?: null | string | number | NutrientViewer.Immutable.List<string>;
                },
            >
        )[]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • ...collections: any[]

      Returns this

    • Parameters

      • merger: (oldVal: any, newVal: any, key: any) => any
      • ...collections: (
            | Iterable<[string, any]>
            | Partial<
                {
                    isFitting?: boolean;
                    name?: string;
                    optionIndexes?: NutrientViewer.Immutable.List<number>;
                    value?: null | string | number | NutrientViewer.Immutable.List<string>;
                },
            >
        )[]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • ...collections: any[]

      Returns this

    • Parameters

      • merger: (
            oldVal: any,
            newVal: any,
            key: "name" | "isFitting" | "value" | "optionIndexes",
        ) => any
      • ...collections: (
            | Iterable<[string, any]>
            | Partial<
                {
                    isFitting?: boolean;
                    name?: string;
                    optionIndexes?: NutrientViewer.Immutable.List<number>;
                    value?: null | string | number | NutrientViewer.Immutable.List<string>;
                },
            >
        )[]

      Returns this

    • Type Parameters

      • K extends "name" | "isFitting" | "value" | "optionIndexes"

      Parameters

      • key: K

      Returns this

    • Parameters

      Returns this

    • Type Parameters

      • K extends "name" | "isFitting" | "value" | "optionIndexes"

      Parameters

      Returns this

    • Parameters

      Returns this

    • Deeply converts this Record to equivalent native JavaScript Object.

      Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.

      Returns { isFitting?: any; name?: any; optionIndexes?: any; value?: any }

    • Shallowly converts this Record to equivalent native JavaScript Object.

      Returns {
          isFitting?: boolean;
          name?: string;
          optionIndexes?: NutrientViewer.Immutable.List<number>;
          value?: null | string | number | NutrientViewer.Immutable.List<string>;
      }

    • Shallowly converts this Record to equivalent JavaScript Object.

      Returns {
          isFitting?: boolean;
          name?: string;
          optionIndexes?: NutrientViewer.Immutable.List<number>;
          value?: null | string | number | NutrientViewer.Immutable.List<string>;
      }

    • Returns Keyed<
          "name"
          | "isFitting"
          | "value"
          | "optionIndexes",

              | undefined
              | null
              | string
              | number
              | boolean
              | NutrientViewer.Immutable.List<string>
              | NutrientViewer.Immutable.List<number>,
      >

    • Type Parameters

      • K extends "name" | "isFitting" | "value" | "optionIndexes"

      Parameters

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • updater: (value: any) => any

      Returns this

    • Returns boolean

      Map#wasAltered

    • Note: Not all methods can be used on a mutable collection or within withMutations! Only set may be used mutatively.

      Parameters

      • mutator: (mutable: this) => any

      Returns this

      Map#withMutations