Global variables can be stored as follows:
- Per JAXFront DOM
- Per JavaVM (for an entire application).
A global variable is a substitute symbol, which can be set respectively and deleted at any time by an application that uses JAXFront.
A variable is always defined by a key and string value.
Variables, held per DOM, can be set on the JAXFront-DOM-instance by com.jaxfront.dom.Document.setUserProperty(String key, String value).
To use globally defined variables in the XUI definition:
- End the defined key of the variable with the prefix $(start and the suffix).
Example:
Codeblock | ||||
---|---|---|---|---|
| ||||
<propertyChange> <formulaExpression>"The current email will be inserted here: $(USER_EMAIL)" </formulaExpression> </propertyChange> |
At run-time, the variable USER_EMAIL is replaced with the set value.
If the variables are DOM independent, they can be defined with the same method, JAXFrontProperties.getInstance().setUserProperty(String key, String value).