Skip to content

applyBox() function

Creates a container for displaying icons and messages.

Syntax

applyBox()
applyBox(stateValues)
applyBox(effectID, stateValues)
applyBox(htmlElement, effectID, stateValues)
applyBox(effectID, htmlElement, stateValues)
applyBox(effectID, stateValues, htmlElement)
applyBox(htmlElement, stateValues, effectID)
applyBox(stateValues, htmlElement, effectID)
applyBox(stateValues, effectID, htmlElement)

Parameters

  • htmlElement optional
    An object that implements the HTMLElement interface.
    Default: undefined.

  • effectID optional
    A string identifier of the effect.
    Default: A unique string value for each function call.

  • stateValues optional
    An object that specifies values for validity states. The available properties are:

    • true optional
      An object with properties for the validity state equal to true. The available properties are:

      • delay optional
        A number in milliseconds for the effect to be deferred for this validity state.
        Default: 0.

      • value optional
        The content to be placed inside the container for this validity state. Can be a string, font icons, any valid HTML or SVG content, or a renderer function which accepts a ValidationResult and returns any kind of the mentioned content.
        Default: an empty string ''.

    • false optional
      An object with properties for the validity state equal to false. The available properties are:

      • delay optional
        A number in milliseconds for the effect to be deferred for this validity state.
        Default: 0.

      • value optional
        The content to be placed inside the container for this validity state. Can be a string, font icons, any valid HTML or SVG content, or a renderer function which accepts a ValidationResult and returns any kind of the mentioned content.
        Default: an empty string ''.

    • mode optional
      Sizing mode of the container.
      Default: 'MIN_SIDE'.

    • position optional
      Positioning mode of the container.
      Default: 'LEVEL_RIGHT_BESIDE'.

    • style optional
      Additional styles for the container.
      Default: undefined.

Return value

An Array with two functions:

  1. A function for cancellation the effect if it is deffered.
  2. A function for setting the effect.

Both functions accept the following arguments:

Exceptions

See exceptions of the function returned by the createApplyEffect() function.

Description

This function was created with using createApplyEffect().

See the description of applyEffect(), cancelEffect(), setEffect() on the createApplyEffect() function page.


Implementation: apply-box.js.

Examples