Overriding Default Canvas Properties
Canvas contains its own property descriptor to display the labels of the Canvas components such as the tool-tip texts on the canvas apps, error and information messages about form items, and other labels that appear apart from the developer's control. The Canvas property file name is canvas-default.properties (expertctstudioResource.jar).
Some of the label keys in the canvas-default_en_US.properties file are as follows:
# Tools tips text for the app tools TOOL_TIPS_REFRESH = Refresh TOOL_TIPS_PRINT = Print TOOLTIP_PIN = More TOOL_TIPS_MAXIMIZE = Maximize
Apart from providing common properties, Canvas also provides the extension to override these properties so that the developer provided values appear. The developer can create their own property file that contains the list of canvas common label keys and values. After creating the property file, the developer must enter the property file name against the label key CT_LABELS_OVERRIDE_BUNDLE_NAME in the multilingualconfig.properties file.
Adding an entry in the override bundle will update the default message for all the apps globally.
Developers must keep in mind that overriding Canvas default properties by creating own property file will require the end users to clear the browser cache. To override the default messages without forcing users to clear the browser cache, you can make an entry for the following columns in the LOCALE_KEY_VALUE table as follows:
- APPLICATION_ID - Indicates the application ID. For example, MODELHOUSE.
- DEFINITION - Indicates the bundle name. Must be 'canvas-default'.
- LOCALE_KEY - Indicates key representation of the text (similar to the key in the property file). For example, NO_DATA_MSG.
- LOCALE_VALUE - Indicates the the locale text for the key. For example, 'Please note that there is no data available.'
- LANG_ID - Indicates the language code that text represents. For example, 'en_US'.
To customize the default message for a specific widget, refer Overriding Default Data Messages for Specific Widget.
A sample multilingualconfig.properties is as follows:
# This will be used to override the default labels provided by Canvas. CT_LABELS_OVERRIDE_BUNDLE_NAME = mycanvas
A sample mycanvas_en_US.properties file is as follows:
TOOL_TIPS_REFRESH = Reload Data TOOL_TIPS_PRINT = Print TOOLTIP_PIN = More... TOOL_TIPS_MAXIMIZE = Maximise
Overriding Default Data Messages for Specific Widget
Canvas provides two properties for displaying the default messages for widgets. The first property is NO_DATA_MSG that is used when there is no application data to display on the widget. The second property is NO_DATA_TO_DISP that is used when the logged-in user is not entitled to view the application data. The default values of these properties are as follows:
# The message to be displayed if there is no data in the list view NO_DATA_MSG = Sorry, there is no data to act upon. NO_DATA_TO_DISP = No data to display.
If suppose, you want to customize these messages based on some context, e.g. a widget displaying recent transactions must display an appropriate message when there are no recent transactions. To achieve this, you must append the widget ID (view ID) to the NO_DATA_MSG property in the resource bundle configured for the widget as follows:
<VIEW_ID>_NO_DATA_MSG = <messages text> # For example: VW_RECENT_TRAN_NO_DATA_MSG = There are no recent transactions in the last 10 days.