Client-Side Bindings - View Properties
Client-Side Bindings - View Properties
Expressions defined in view properties (view, panel, field, action, etc) are evaluated on the client, using the client-side evaluation context that includes following objects:
-
user
: includes all properties of the current user account, as well as properties of the employee record associated with the user.
-
view
: provides access to properties of the parent View, such aspanels
array orrestriction
object.
-
panel
: provides access to properties of the parent panel, such asnewRecord
orfieldDefs
array; this can be used to access field input values as well.
-
record
: provides access to all record field values, including primary keys; this works for the form records, as well as for grid row records.
Reserved Characters
Note that in your expressions, you cannot use reserved characters, such as an ampersand for a logical AND.
Two "&&" characters (as for a logical AND) are specified as
&&
. Note the trailing semicolon, which is required.
A single "&" character is specified as
&
For example:
title="Environment & Risk Process"
Examples:
The view title displays the current user name:
<title>Hello ${user.name}</title>
The field value displays the current user location:
<field table="em" name="rm_id" value="${user.space.roomId}">
The Approve panel button is disabled if the current project is already approved:
<action id="approve" enabled="${record['project.status'] != 'A'}">
The Approve tab page is hidden if the current project is already approved:
<tabPage name="approve" hidden="${record['project.status'] == 'A'}">
The field displayed only in Debug mode shows the current panel restriction:
<field hidden="${!view.debug}" controlType="text" value="${restriction.toString()}"/>
The following view properties can contain binding expressions:
• View: Title
• Panel: Title
• Tab page: Title;
Enabled; Hidden
• Action:Title;
Enabled; Hidden
• Field:
Title;
Read-only; Enabled (for per-row grid buttons); Hidden;
Value.
For additional examples, see Client Side Implementation.