OpenWGA 7.4 - WebTML reference
WebTML tags » [All tags]<tml:[All tags] if/unless ="itemexpression">
Purpose:
If any condition in the if expression is false the tag is not rendered.
If any condition in the unless expression is true the tag is not rendered.
Description:
Attributes "if" and "unless" on WebTML tag:
Both attributes receive a "boolean item expression" which tests WebTML items and calculates a boolean result. When "if" it present its expression must return true for the tag to be rendered, otherwise it is cancelled. When "unless" is present and its expression returns true the tag is also cancelled.
Both attributes receive a "boolean item expression" which tests WebTML items and calculates a boolean result. When "if" it present its expression must return true for the tag to be rendered, otherwise it is cancelled. When "unless" is present and its expression returns true the tag is also cancelled.
The "unless" expression has priority over the "if" expression. When both are present and evaluate true then the tag is cancelled.
Boolean item expression
A simple expression syntax to use WebTML items for evaluating a boolean result. Consisting of:- Item term: Just anything that is valid in this.item() as item name, like names of content items, WebTML variables, Renderer/Controller property expressions
- Boolean Operators: & being and, | being or, between those item terms. There may be only one type of boolean operator on one expression, so "a | b", "a & b & c" is valid, "a | b & c" is invalid.
- Brackets to form sub expressions, where again a single boolean operator can be used, differing from the one on the main expression: "(a | b) & c"
- Exclamation mark operators to negate either item expressions or sub expressions: "!a", "!(a & b)"
Every item term is evaluated for its boolean value by the rules of TMLContext.isTrue(). Then the boolean values are combined in the ways determined by operators to form a result value.
Value(s):
Item expression
Examples:
<tml:input name="product" if="products_available"/>