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:
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 is to be used as the fallback value.
Data Field
Select the required data field.
Select data field of 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. If, for example, an integer value is required, "123" can be transferred, but not "ABC".
For 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 used rudimentarily for page parameters. Objects such as $DC, $drRecord are not available at this point, 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 language of the portal" 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 desired 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. You can find instructions here.
Date & time
If a data field with control type "Date & time", "Date" or "Time" is selected as the display value, the date can be adjusted here. All information about the settings can be found here.
Automatic increase
If a data field with control type "Integer" is selected, a counter can be set up with this option. 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 jumps in the "Tree view" 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. The "Node ID" value is a comma-separated value made up of the key, the parent key and the sorting. The value "Parent node ID" corresponds to the parent key. The "Title" value is the title of the current node.
Appointment
This option can only be selected for calendar plugins. All data defined in the plugin properties on the "General" tab can be selected here.
Resource
This option can only be selected for calendar plugins if the setting "Enable resource display" is set on the "Options" tab. The data fields that are selected on the "Options" tab as title field, sort field, grouping field or image are available for selection.
Resource
Select the corresponding resource data field here.
Current data group
This option can only be selected if no ReadContainer is supported, e.g. 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"
You can find all further information here.
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 with the "Data field" option. It can also be entered as a 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 using 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 from "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 with the "Request" option. It can also be entered as a 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 a 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 a 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 with the "More" option, "parameter['']" is generally used, as this notation is more intuitive and the keyword "parameter" is also used in the Velocity and Groovy environment.
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 using the following syntax:
velocity['TEXT'] => The interpreted velocity TEXT will be returned
defaultLanguage
Returns the portal default language (corresponds to $defaultLanguageinVelocity).
contextLanguage
Returns the current portal language (corresponds to"$lang" in Velocity)
appUserProfile
appUserProfile['key']
Returns a value from the UserProfile. Further information can be found here.
Resolve value
Time to resolve value
If possible, the time for resolving the value when loading the current page or when loading the target page can be configured here.
Binding type "appUserProfile"
This binding type can be used to save data for each user. you can save information for the 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 - just user-dependent. 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 persistently available.
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 permanently available within an application. |
appUserProfile | Yes | Value is available until the user sets a new value. |
Implementation "No code"
If the value is defined and saved on input pages, the binding can be used without programming.
The binding can be defined on input pages when creating a WriteContainer. The user-defined class "AppUserProfile" is available there.
The control that defines the values is included 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 write container is available for the definition in which the binding type "appUserProfile" can be defined, this can also be set using Velocity and Groovy. You can find all information on using it in Groovy or Velocity script here:
More information
Parameters - an overview
Create parameters, fallback and semantic values