You are here:
Resource
The Resource element is used to bind localized
texts, labels, images, and so on, into the UI. The default value is shown if there are no
localized files for the selected language.
Required Editions
| Available in: Lightning Experience in Professional, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled. |
Attributes
The table lists the common attributes available for the Resource element.
| Attribute | Description | Values | Required? |
|---|---|---|---|
| target | The target describes what the actual UI element is. | Depends on the UI element, that is, title, Info, Text, or Image. | Yes |
| type | The type defines how the resource is shown. | Info, Text, Label, or Image. | Yes |
| defaultLabel | One default value can be set, depending on the type, that is, defaultText, defaultLabel, and defaultImage. | Depends on the type. | No |
| id | The ID that is used for mapping the localized resource and the actual element in the UI. | Any string. | Yes |
| bindingMode | The binding mode that is used to control the updating process. | ONE_TIME, ONE_WAY, or TWO_WAY. | No. By default, it is set to ONE_TIME |
| wrapping | Only applies if type = Label. Determines whether a long line of text is
wrapped (true) or trimmed (false). |
True or false (default). | No |
bindingModes
| bindingMode | Description |
|---|---|
| ONE_WAY | Updates the value displayed in the UI if the value in the object changes. |
| TWO_WAY | Updates both the value displayed in the UI and the value in the object if one of the values changes. |
| ONE_TIME | The value in the object is written one time into the UI. Nothing is updated if one of the values changes. |
The following code sample shows the usual XML syntax:
<Bindings>
<Resource target="Title" type="Label" id="startOfDayLabelId" defaultLabel="Start of Day" />
</Bindings>Did this article solve your issue?
Let us know so we can improve!

