Configure How Variables are Customized in the Properties Pane
You can customize variables and constants when developing an App UI, so that users extending the page have a more intuitive experience when configuring values in the Page Designer's Properties pane.
When a page is open in the Page Designer, the page's extendable variables and constants are listed in the Constants tab in the Properties pane. Users extending the page can set the values of those variables and constants, usually displayed as text fields in the Page Designer's Properties pane. For example, here's how a constant used to store a date displays by default in the Properties pane:
Description of the illustration constant-text-picker.png
In some cases, a different UI component can make editing the variable or constant more intuitive. In the case of the constant that stores a date, displaying a date picker instead of a text field can improve the experience when a user edits its value in the Page Designer:
Description of the illustration constants-rich-picker.png
Note:
Some UI customization options are not available in the Design Time tab. You'll need to edit the JSON directly to configure these advanced options. See the Customizing the JSON section below for a full list of customization options.Customize Variables and Constants in the Variables Editor
- Open the Variables editor.
- Select the variable or constant you want to customize.
- Select the Design Time tab in the Properties pane.
- Select properties to customize how the component for editing the variable will look in the Page Designer.
The properties you see in the Design Time tab will depend upon the variable's type, and the Subtype property you select in the tab. For example, if Date is selected as the Subtype, you'll see fields for setting Minimum and Maximum limits for the date:
Description of the illustration constant-designtime-tab.png
Customization Option | Steps in Design Time Tab | Result in Page Designer |
---|---|---|
To display a color picker: |
For a string-type variable or constant:
|
|
To display a date or date-and-time picker: |
For a string-type variable or constant:
|
|
To display an endpoint picker: |
For an object-type variable or constant:
Note: The Placeholder field does not take effect in the Properties pane when you use the Endpoint subtype. |
Clicking Select launches a Configure Endpoint wizard in which fragment users can select a suitable endpoint and choose its URI parameters.
Tip: If you cannot find the endpoint you want or prefer to manually set up your endpoint, click the Manual Setup of Endpoint icon (![]() |
To display a drop-down menu containing an array of possible values: |
For a string-type variable or constant:
|
|
To display a time picker: |
For a string-type variable or constant:
|
|
To display a drop-down menu with a list of time zones: |
For a string-type variable or constant:
|
|
To limit the input values to a number in a range: |
For a number-type variable or constant:
|
|
"constants": {
"hireDate": {
"type": "string",
"@dt": {
"subtype": "date",
"label": "Date of Hire",
"valueOptions": {
"placeholder": "Select a date"
}
}
}
},
Customize the JSON with Metadata
- Open the JSON editor.
- Update the variable or constant's definition by setting the
@dt
element, then use thesubtype
property to specify the component you want displayed in the Page Designer. The JSON editor displays a hint to help you select the value for thesubtype
property.
subtype
property to businessObject
:"constants": {
"relatedObject": {
"type": "string",
"@dt": {
"subtype": "businessObject",
"label": "Related Object"
},
"description": "Description of related object"
}
},
Use the label
property to change the constant's display name in the Properties pane.
Property Options for Variable Metadata
Property | Type | Description |
---|---|---|
label | string |
Use this property to specify a user-friendly name for the variable. |
subtype | Available subtypes:
|
Use this property to create a more specific type of customizer for simple types. For example, you can choose "date" to use a date picker component for a string type. |
valueOptions | object |
The valueOptions available to you depend on the selected subtype. When no subtype is selected, the only valueOptions is placeholder . See the tables below for a list of valueOptions properties.
|
Properties for valueOptions
Depending on the subtype you select for the variable, you can use the following properties to further customize the components used for editing fields in the Page Designer.
Property | Description | Usage |
---|---|---|
fields |
Use this to customize the display/editing of object values. Instead of displaying a simple single text area for the whole value, the Properties pane will display individual customizers for the various fields of the object. |
Property type: array You can specify an array of fields of the associated variable or constant that you want displayed in-line in the Properties pane when editing the object's values. You can customize how each field is displayed by using When using the Note: This property is only supported for displaying the first level of object fields.A variable described with the following metadata:
would look similar to this in the Properties pane: The
fields property can be used to customize how the object is displayed:
The customized object would look similar to this in the Properties pane: |
maximum |
Use this property to specify the inclusive top limit of a range when specifying a value in the Properties pane. |
Property type: number | string This property is suitable for numbers and date/time formats. An example of values for the
maximum property:
For further details about the JET 'maximum' metadata property, see JET component metadata properties in the Oracle JET JavaScript Extension Toolkit documentation. |
minimum |
Use this property to specify the inclusive bottom limit of a range when specifying a value in the Properties pane. |
Property type: number | string This property is suitable for numbers and date/time formats. An example of values for the
minimum property:
For further details about the JET 'minimum' metadata property, see JET component metadata properties in the Oracle JET JavaScript Extension Toolkit documentation. |
placeholder |
Use this property to specify a user-friendly hint text. |
Property type: string This property can be used in Properties pane customizers that have placeholder support, for example, JET Input type customizers. An example of configuring a value for the
placeholder property:
If a default value is supplied by the constant, then that default value is used as the default placeholder. If both a placeholder value is used and the default value is specified, then the placeholder will be used. |
service
|
Use this property to fetch possible values from a service for an List of Values (LOV) picker. |
Property type: object When using the The service response must be in JSON format, and the response items in an array. In the
lov subtype example below, the now constant will be offered a choice of values to pick from, which are determined by the response from a REST endpoint:
The example above displayed in the Properties pane: See the LOV Metadata Property Values table below for details about the property values. |
translatable |
Use this to specify if translation helpers should be present for the property. |
Property type: boolean Translation is only available for string types. An example of configuring a value for the
translatable property:
|
values |
Use this property to specify an array of possible values for the field. |
Property type: object This property can be used with the Values must include An example of using the
values property:
The example above displays in the Properties pane as shown here: For further details about the JET 'enumValues' metadata property, see JET component metadata properties in the Oracle JET JavaScript Extension Toolkit documentation. |
LOV Metadata Property Values
You can assign the lov
subtype to a variable if you want to display a drop-down list of values (LOV) for the variable in the Properties pane. To use the lov
subtype you'll need to set valueOptions
property values to specify where the LOV data is retrieved from, and to configure how the drop-down list will look in the Properties pane.
Name | Description | Example |
---|---|---|
service |
Type: object This describes the service to retrieve the LOV data from, and how to use it. |
See service example above.
|
request |
Type: object This describes what service to call, and how to call it. |
See service example above.
|
request.endpoint |
Type: string This is the fully-qualified name of a VB Studio service that you are able to access. |
"my-app-ui:Petstore/getNowPlaying" |
request.pathParameters |
Type: Object This maps endpoint path parameter names, and the values to replace them with. The values can also be VB Studio constants (see below). |
|
request.uriParameters |
Type: Object This maps URI path parameters to the values they should be replaced with. The values can also be VB Studio constants (see below). |
|
response |
Type: object This describes how to unpack the payload returned by a successful response. |
See service example above.
|
response.itemsPath |
Type: string This is a dot-separated path from the root of the response object to the array containing the LOV values. |
"results" |
response.mapping |
Type: object This describes how to populate the LOV from the response object. The mapping should indicate which response fields are to be used for the |
See service example above.
|
response.mapping.description |
Type: string (optional) This describes the field from the response object that is used in the drop-down item description. It appears below the |
"overview" |
response.mapping.label |
Type: string (optional) This describes the field from the response object that is used as the primary display name of the item in the drop-down menu and in the input. |
"title" |
response.mapping.value |
Type: string This describes the field from the response object that is used as the actual value of the variable/constant. It is visible to the right in the drop-down menu. |
"id" |
Using dependent parameters for "lov" metadata property values
"pathParameters": {
"department": "[[ $constants.dept ]]"
}
The expression instructs this service request to use the current value of the "dept" constant as the value to use for the path parameter "department".
- Only simple direct references may be used. Calculated expressions such as
"[[ $constants.dept + "_" ]]"
will not work as expected. - Only constants can be used. Variables cannot be used.
- The referenced constants must be accessible to the extension performing the LOV service call.