Fallback value / Binding
A binding is a connection between a data source and a consumer. The data source is specified in the binding notation (see Syntax of binding strings). Bindings can be defined in different places in Intrexx. Based on this, they are also added to the XML at different points. Bindings can be implemented as follows:
-
as the displayed value of elements
-
as the default value of elements
-
in filters
-
in Velocity
-
in Groovy
Define binding as default (e.g. for input fields)
For input fields, a data field binding can be defined as a default for new data records on the "Binding" tab in the properties dialog.
Specify the desired control type and the display value here.
Default for new data records / for existing data records
Default values are used if the binding does not provide a value for new or existing data records. Click on "Edit default value" to define a new default value.
Select the desired binding here and click "OK".
"Accept default value" accepts the defined default value.
Here is the corresponding XML, which you can access with activated expert options via the highlighted input field by pressing the F4 key:
<textcontrol guid="5758A9C9EC60A724AC85B3CAE8F2EA28B23EFE45" name="textcontrol30057DD4" inputlength="255" label="false" readonly="false" rect="100,45,250,20" required="false" source="container['7338AC8FD8B5B5C39DBB2AD2F456529DD84A233A'].dataField['D6F55F095F2E5A5570EAB98A8773B0E2F193FBA1']">
<property>
<title de="Titel" en="Title"/>
</property>
<defaultvalue record="new" source="container['7338AC8FD8B5B5C39DBB2AD2F456529DD84A233A'].dataField['8860BBDFB02E3E9E43940D63A4A64A0AACAEF2DC']" sourceType="binding"/>
</textcontrol>
Data field
Containers
Select the desired container that contains the data field whose value should be used as the fallback value.
Data field
Select the required data field.
Select a data field from a parent data group
Opens a dialog in which a data field can be selected from a higher-level data group if necessary.
Session / Request / Processing context
Enter the name of the request parameter, the session variable or the variable from the processing context, respectively.
Static value
Enter a static value. Any character string can be entered as long as it corresponds to the required data type. For example, if an integer value is required, "123" can be transferred, but "ABC" cannot.
With checkboxes, the setting "Selected" can be activated or deactivated here as a static value, depending on whether the checkbox should already be selected when the page is loaded in the browser or not.
With the "Multiple selection 2.0" element, it is also possible to specify several static values here, separated by a double pipe.
Velocity
A Velocity script, which provides the fallback value, can be entered here. Velocity can only be implemented rudimentarily for page parameters. Objects like $DC, $drRecord are not available at this put but if/else constructs can be used.
New GUID
This option automatically generates a GUID that is used as a fallback value.
Language
For the language, you can choose between "Default portal language" and "Context-dependent language". The context-dependent language is determined by the chain
- rq_lang/cookie_lang
- Default language for the current user
- Default portal language
Current user
A data field from the "User" module can be selected here.
System data group
Application
Select the application that contains the system data group.
Data field
Select the data field here.
Parameters
Select the desired parameter whose fallback values should be used. All parameters of the current page are available for selection.
Parameters (Application API)
API parameters can be selected for comparison in the API environment. A guide to creating a connection is available here.
Date and time
If a data field with the "date/time", "date" or "time" control type is selected as the displayed value, the date can be adjusted here. Click here for more information about these settings.
Automatic increase
If a data field with the “integer” control type is selected, a counter can be set up with this option here. When a new data record is created, the value last entered will be increased by 1. This new value is used as the preset value.
Tree
This option is only available for links in the "View tree" element.
Current tree node value
For the value of the current tree node, you can choose between the primary key, the node ID, the parent node ID or the title. "Node ID" is a comma-separated value consisting of the key, the parent key and the sorting. "Parent node ID" corresponds to the parent key. "Title" is the title of the current node.
Appointment
This option is only available for calendar plugins. All dates, which have been defined on the "General" tab of the plugin properties, can be selected here.
Resource
This option is only available for calendar plugins if the setting "Enable display of resources" has been activated on the "Options" tab. All data fields, which have been selected as the title field, sorting field, grouping field or image on the "Options" tab are available for selection.
Resource
Select the corresponding resource data field here.
Current data group
This option is only available if a ReadContainer is not supported, such as in processes.
Data field
Select the required data field.
Other
Under the "More" option, you will find a selection list for binding types to which you can assign values.
Save data persistently per user with "appUserProfile"
See here for further information.
Bindings
Syntax of binding strings
bindingType
bindingType['guid|name']
bindingType["guid|name"]
bindingType.guid
bindingType.name
bindingType['guid|name'].guid
bindingType["guid|name"].name
bindingType['guid|name'].subtype['guid|name']
bindingType["guid|name"].subtype["guid|name"]
bindingType["guid|name"].subtype["guid|name"].name
...
Not all bindings are available in every context.
compatibility.primaryKey compatibility.primaryKey['name'] compatibility.foreignKey compatibility.foreignKey['name'] compatibility.primaryOrForeignKey compatibility.primaryOrForeignKey['name']
containers
Returns the value of a ReadContainer or WriteContainer. This binding can be defined for the "data field" option. It can also be entered as the value for the "Other" option with the following syntax:
container['GUID|NAME'].dataField['GUID|NAME']
container['GUID|NAME'].member['GUID|NAME']
container['GUID|NAME'].recordOwner (The value of record owner field)
container['GUID|NAME'].userId (The value of userid field)
container['GUID|NAME'].key (The value of the single primary key)
container['GUID|NAME'].primaryKey (The value of the single primary key)
container['GUID|NAME'].key['GUID|NAME'] (The value of the primary key with the GUID or name)
container['GUID|NAME'].primaryKey['GUID|NAME'] (The value of the primary key with the GUID or name)
container['GUID|NAME'].foreignKey['GUID|NAME'] (The value of the foreign key with the GUID or name)
container['GUID|NAME'].foreignKey (The value of the single foreign key)
container['GUID|NAME'].combinedKey (The value of the single primary key or a formated Key string like "LID= 1, LANG= de")
container['GUID|NAME'].combinedPrimaryKey (The value of the single primary key or a formated Key string like "LID= 1, LANG= de")
container['GUID|NAME'].combinedForeignKey (The value of the single foreign key or a formated Key string like "LID= 1, LANG= de")
control
Returns the value of a control. This binding can be entered as the value of the "Other" option with the following syntax:
control['GUID']
control['NAME']
control.guid['CONTROLGUID']
control.name['CONTROLNAME']
control.sysIdent['SYSIDENT']
currentDate
Returns the current date without the time.
currentDate currentDate['Y,M,D'] currentDate[+1,2,-3] Adjust current date: Year +1, month = 2, day -3 Y=(|[+-]?\d+) M=(|[+-]?\d+) D=(|[+-]?\d+)
Rules definition: See p_adjust in de.uplanet.util.CalendarUtil.modifyCalendar(T, String p_adjust, boolean)
currentDatetime
Returns the current date with the time.
currentDatetime
currentDatetime.%TIMEZONE%
currentDatetime['Y,M,D,H,m,S']
currentDatetime[+1,2,-3,2, +2, 0] Adjust current date: Year +1, month = 2, day -3, hour=3,min+2,sec=0
Y=(|[+-]?\d+)
M=(|[+-]?\d+)
D=(|[+-]?\d+)
H=(|[+-]?\d+)
m=(|[+-]?\d+)
S=(|[+-]?\d+)
currentDatetime['Y,M,D,H,m,S'].%TIMEZONE%
Rules definition: See p_adjust in de.uplanet.util.CalendarUtil.modifyCalendar(T, String p_adjust, boolean)
%TIMEZONE% must be a valid time zone ID (such as UTC).
currentTime
Returns the current time.
currentTime currentTime['H,m,S'] currentTime[+1,2,-3] Adjust current date: Hour +1, minute = 2, second -3 H=(|[+-]?\d+) m=(|[+-]?\d+) S=(|[+-]?\d+)
Rules definition: See p_adjust in de.uplanet.util.CalendarUtil.modifyCalendar(T, String p_adjust, boolean)
currentUser
Returns the current user.
currentUser[FIELDGUID|NAME]
Replace "NAME" with the bean name.
recId
Returns a value of "old" rq_RecId or qs_RecId arguments with the format: "LID= 1; LANG= de". This binding is used for compatibility reasons and should not be written manually.
recId['LID'](gets the LID value out of the rec id string )
recId['LANG'](gets the LANG value out of the rec id string )
request
This binding can be defined for the "Request" option. It can also be entered as the value for the "Other" option with the following syntax:
request['name']
sharedState
This binding can be defined with the "Processing context" option It can also be entered as the value for the "Other" option with the following syntax:
sharedState['name']
session
This binding can be defined with the "Session" option. It can also be entered as the value for the "Other" option with the following syntax:
session['variable name']
staticText
Returns static text
staticText['TEXT'] => TEXT will be returned
systemDataGroup
Returns the value of a data field from a system data group from the current or a specific application.
systemDataGroup['APP_GUID'].dataField['FIELD_GUID']
target.argument, parameter
Returns a parameter value. target.argument[''] can be defined with the "Parameter" option. If a binding itself is created using the "Other" option, "parameter['']" is typically used instead as this notation style is more intuitive and the keyword "parameter" is used in both the Velocity and Groovy environments.
parameter['NAME']
target.argument['NAME']
uniqueId
Generates a random number.
uniqueId
uniqueGuid
Generates a GUID.
uniqueGuid
velocity
Returns the Velocity text of the binding. It tries to interpret the text. This binding can be entered as the value of the "Velocity" option with the following syntax:
velocity['TEXT'] => The interpreted velocity TEXT will be returned
defaultLanguage
Returns the portal default language (corresponds to $defaultLanguage in Velocity).
contextLanguage
Returns the current portal language (corresponds to "$lang" in Velocity)
appUserProfile
appUserProfile['key']
Returns a value from the UserProfile. Click here for more information.
Resolve value
Time to resolve value
If possible, you can define whether the value should be resolved when the current page is loaded or when the destination page is loaded.
Binding type "appUserProfile"
This binding type can be used to save data for each user. You can save information for the respective current user in any value and retrieve it at any time, e.g. as a default value in input fields.
"AppUserProfile" can be used in a similar way to a system data group - namely only user-dependently. For example, you can control user-dependent views in this way. In principle, it works like a SharedState or a session variable, except that the data is available persistently.
Delimitation
The "appUserProfile" binding type expands the options for saving and processing any information individually for a user.
Method | User-dependent | Availability |
SharedState / Processing context | No | Value is available until a new value is set. |
Session variable | Yes | Value is available within a session. |
Request value / Parameter | No | Value is available for an action. |
System data group | No | Value is available permanently within an application. |
appUserProfile | Yes | Value is available until the user sets a new value. |
"No code" implementation
If the value is defined and saved on edit pages, the binding can be used without programming.
The binding can be defined on edit pages when creating a WriteContainer. The user-defined class "AppUserProfile" is available there.
The control that defines the values is applied in this WriteContainer. The target is defined in the properties of the binding.
The value can then be stored in the default of a control. To do this, the binding type "appUserProfile" can be selected under "Other" and the defined value stored.
Low code" implementation
If no WriteContainer is available for the definition in which the binding type "appUserProfile" can be defined, it can also be set using Velocity and Groovy. Detailed information on the use in Groovy or Velocity script can be found here:
More information
Parameters - An overview
Create parameters, fallback values and semantic values