Initializing help system before first use

ComponentParamsBuilder

A builder API to add, read and serialize component params to a DOM element.

Method summary

name description
addFunctionOrExpressionParam Add an expression component param, which should resolve to either a function or a javascript expression. If it resolves to an expression, it will be wrapped into a function, which takes arguments specified in params argument.
addParam Add a component param.
addParentCallbackParam Add a component param which holds a reference to the named callback function in the parent extension.
addRawOrExpressionParam Add a component param using a parsed VDL attribute. Automatically set the param as an expression if provided.
clearParams Clear all existing params from the element.
getParam Get the value for a specific param.
getSerializedParams Serialize the component params on the element in a compatible way, i.e. do not wrap expression in quotes. Values that are an object of type {value: string, isExpression: true} will not be wrapped in quotes so VDL will treat them as expressions.
hasParam Check for a specific name component param.
hasParams Check if the element has any component params.
isParamExpression Check whether a given param has been specified as a dynamic expression.

Constructor

new ComponentParamsBuilder ( element )

A builder API to add, read and serialize component params to a DOM element.

Parameters:
Name Type Description
element Element The DOM element to add component params to

Methods

addFunctionOrExpressionParam ( name, paramExpression, argumentNames ) → {ComponentParamsBuilder}

Add an expression component param, which should resolve to either a function or a javascript expression. If it resolves to an expression, it will be wrapped into a function, which takes arguments specified in params argument.

Parameters:
Name Type Argument Description
name string The param name
paramExpression String A parsed VDL attribute expression
argumentNames Array optional  An array of argument names
Returns:
Type Description
ComponentParamsBuilder The builder so calls can be chained
Back to Top
addParam ( name, value, isExpression ) → {ComponentParamsBuilder}

Add a component param.

Parameters:
Name Type Argument Default Description
name string The param name
value string | boolean | number The param value
isExpression boolean optional  false Is the param a dynamic expression
Returns:
Type Description
ComponentParamsBuilder The builder so calls can be chained
Back to Top
addParentCallbackParam ( name ) → {*|ComponentParamsBuilder}

Add a component param which holds a reference to the named callback function in the parent extension.

Parameters:
Name Type Description
name the name of the callback.
Returns:
Type Description
* | ComponentParamsBuilder
Back to Top
addRawOrExpressionParam ( name, vdlAttribute ) → {ComponentParamsBuilder}

Add a component param using a parsed VDL attribute. Automatically set the param as an expression if provided.

Parameters:
Name Type Description
name string The param name
vdlAttribute VdlAttribute A parsed VDL attribute
Returns:
Type Description
ComponentParamsBuilder The builder so calls can be chained
Back to Top
clearParams ( )

Clear all existing params from the element.

Back to Top
getParam ( name ) → {string|boolean|number}

Get the value for a specific param.

Parameters:
Name Type Description
name string The name of the param to fetch
Returns:
Type Description
string | boolean | number The primitive value of the param
Back to Top
getSerializedParams ( ) → {string|undefined}

Serialize the component params on the element in a compatible way, i.e. do not wrap expression in quotes. Values that are an object of type {value: string, isExpression: true} will not be wrapped in quotes so VDL will treat them as expressions.

Returns:
Type Description
string | undefined serialize representation of the params, undefined if no params set
Back to Top
hasParam ( name ) → {boolean}

Check for a specific name component param.

Parameters:
Name Type Description
name string The param name to check for
Returns:
Type Description
boolean
Back to Top
hasParams ( ) → {boolean}

Check if the element has any component params.

Returns:
Type Description
boolean
Back to Top
isParamExpression ( name ) → {boolean}

Check whether a given param has been specified as a dynamic expression.

Parameters:
Name Type Description
name string
Returns:
Type Description
boolean
Back to Top

© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.