Menu

BindingExpression

Jan Volf

Binding Expression

Binding expression is expression that evaluates to result. It can be defined as attribute value of the component's element where the attribute name matches property of that component or it can be plainly defined inside the text contents.

Example:

<!-- example of expression inside text contents -->
<h:p>Username: {$this->username->value}</h:p>

<!-- example of expression as attribute value -->
<px:TextField px:id="random" readOnly="true" value="{rand(0,10)}"/>

Rules that applies:

  • if attribute value is assigned only to the expression then the property represented by that attribute is assigned to the result of the expression evaluation
  • if expression is combined with the string or other expressions the expression in that combined string is replaced by result of the evaluation converted to string
  • the variable $target can be used in scope of the expression to refer the component whose property is being assigned - binding target

Related

Wiki: Expressions
Wiki: Home

MongoDB Logo MongoDB