Command Reference CIB jsMerge
Functions
ref(variableName) and getData(variableName)
These functions are identical and return the value of the variable “variableName“. To be able to use a variable in these functions it must exist in the data suppy or have been set with “setData”. If that is not the case, the surrounding function will terminate with an error.
Examples:
{# ref(“myVariable”)}
{# ref(“institute.EL_KIN_BEZ”)}
{# var i=1; ref(“institute.EL_KIN_BEZ” + i)}
If the
“variableName” contains a special separator (this is by default a decimal point
“.”), the variable is considered to be a table variable with the first part
describing the table alias and the second part describing the name of the node
that has to be selected within the table. If the variable cannot be resolved,
this function causes the surrounding function to terminate with an error. Attention: If the
return value should be further processed as a number, the ref has to be
surrounded by the standard JavaScript function Number(). Otherwise the content
of the variable will be as evaluated a string. Example:
{# setData(“mySum”, 50)} {# text(Number(ref(“mySum”)) + 10)}