Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

SAPUI5 allows for the use of Expression binding 'in-line' to execute code (for example, to do certain calculations or comparisons) in places where one would normally use a variable, or call a custom function.

For example, on the screen below we want to display/hide the contents of the text control, depending on the value in the input field:


You could:

  1. Define a Boolean variable in the data model (called 'visible', or something similar).
  2. Assign this variable to the 'Visible' property in the Properties of the text field.
  3. Write JavaScript to set the 'visible' field to true or false, depending on the value in the 'Value' input field.

OR, you could:

  1. Use expression binding, accessing the value directly to set the "visible" property of the text control.
Example:
visible="{=${/value} > 10000 }"

(where 'value' is the data model field bound to the Value input field)



You can find more complex examples in the SAP documentation at: Expression Binding

  • No labels