Module: alfresco/forms/controls/HiddenValue

alfresco/forms/controls/HiddenValue

This can be used in forms where it is necessary to set hidden values that are not relevant for the user to see but need to be included in form posts. It was written with the intention of working with the autoSetConfig capabilities of form controls so that additional data can be set as other fields are updated.

This widget should only be used in a Form where either the value of field is simply fixed (in which case you should just consider including that value in the form confirmation button payload)) or where it is the target of some auto-set configuration rules. This widget can also be used programmatically in other widget (e.g. see how it is used in the InlineEditProperty renderer).

If your intention is to be able to see an assigned value in the browser DOM model then you should consider just using a TextBox with the visibilityConfig configured such that the "initialValue" attribute is set to be false so that the TextBox is hidden.

Author:
  • Dave Draper
License:
Source:

Example

Example usage:

{
   id: "SOURCE",
   name: "alfresco/forms/controls/Select", 
   config: {
      fieldId: "SOURCE_FIELD",
      label: "Choose whether to set a hidden value",
      name: "choice",
      value: "1",
      optionsConfig: {
         fixed: [
            { label: "Don't set hidden value", value: "1"},
            { label: "Set hidden value", value: "2"}
        ]
      }
   }
},
{
   id: "TARGET",
   name: "alfresco/forms/controls/HiddenValue",
   config: {
      name: "hidden",
      autoSetConfig: [
         {
            rulePassValue: "VALUE_SET",
            ruleFailValue: "",
            rules: [
               {
                  targetId: "SOURCE_FIELD",
                  is: ["2"]
               }
            ]
         }
      ]
   }
}

Members

___hiddenValue :object

The hidden value attribute. Used by the getValue and [setValue]{@link module:alfresco/forms/controls/HiddenValue#setValue} functions.
Type:
  • object
Default Value:
  • null
Source:

visibilityConfig

Overrides the inherited attribute to ensure the field is invisible.
Source:

Methods

getValue() → {object}

Overrides the inherited function to return the hiddenValue attribute.
Source:
Returns:
The current value of the field.
Type
object

getWidgetConfig()

Source:

setValue(value)

Overrides the inherited function to set the hiddenValue attribute.
Parameters:
Name Type Description
value object The value to set.
Source: