Nutrient Web SDK

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.

Class

Example

Setting a form field value.

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

See Also

Hierarchy

RecordFormFieldValue

Constructors

  • Parameters

    args{ [key: string]: any }
    Optional

Properties

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.

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.

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

The value of the form field.

IObject

Immutable Record API

31
string

The name provided to Record(values, name) can be accessed with displayName.

  • Returns

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

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

    this

    See Also

    • Map#asImmutable

  • Returns

    this

    See Also

    • 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

    Kextends "name" | "isFitting" | "value" | "optionIndexes"

    Parameters

    keyK

    Returns

    this
  • Parameters

    keyPathIterable<unknown>

    Returns

    this
  • Parameters

    otherunknown

    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

    Kextends "name" | "isFitting" | "value" | "optionIndexes"

    Parameters

    keyK
    notSetValueunknown
    Optional

    Returns

    { … }[K]
  • Type Parameters

    T

    Parameters

    keystring
    notSetValueT

    Returns

  • Parameters

    keyPathIterable<unknown>

    Returns

    unknown
  • Parameters

    keystring

    Returns

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

    number
  • Parameters

    keyPathIterable<unknown>

    Returns

    boolean
  • Parameters

    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Parameters

    merger(oldVal: unknown, newVal: unknown, key: unknown) => unknown
    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Parameters

    merger(
    oldVal: unknown,
    newVal: unknown,
    key: "name" | "isFitting" | "value" | "optionIndexes"
    ) => unknown
    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Type Parameters

    Kextends "name" | "isFitting" | "value" | "optionIndexes"

    Parameters

    keyK

    Returns

    this
  • Parameters

    keyPathIterable<unknown>

    Returns

    this
  • Type Parameters

    Kextends "name" | "isFitting" | "value" | "optionIndexes"

    Parameters

    keyK
    value
    { … }[K]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    valueunknown

    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

    { … }
  • Shallowly converts this Record to equivalent native JavaScript Object.

    Returns

    { … }
  • Shallowly converts this Record to equivalent JavaScript Object.

    Returns

    { … }
  • Returns

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

    | string
    | number
    | boolean
    | NutrientViewer.Immutable.List<string>
    | NutrientViewer.Immutable.List<number>
    | null
    | undefined
    >
  • Type Parameters

    Kextends "name" | "isFitting" | "value" | "optionIndexes"

    Parameters

    keyK
    updater
    (value: { … }[K]) => { … }[K]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    updater(value: unknown) => unknown

    Returns

    this
  • Returns

    boolean

    See Also

    • 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) => unknown

    Returns

    this

    See Also

    • Map#withMutations