Hello,
1. It is not possible to access resource bundles from the CoachView event (at least there is no official API for this).
2. You can bind resource key to one of the config options you expose and then you can access it from the coach view. But api to access them is not the tw.XXX . To access config option exposed in the parent coach view you need to use this:
parentView.context.options.myOption.get("value")
I would really want to be able to access resources directly, because aproach with config options really creates some mess in the code.------------------------------
Valentinas Gylys
------------------------------
Original Message:
Sent: Tue May 05, 2020 06:01 PM
From: Laszlo Kertesz
Subject: How to retrieve localized string in a coach view event code?
Hi,
I want to show an alert when a text input is changed in a coach view using the code
bpmext.ui.alert("", tw.resource.MyResource.MyMessage );
for the text input onchange event:
But the message is not displayed (when I use a constant string like "ABC", it is displayed) and no runtime error comes. MyResource contains a MyMessage localizable string of course and is added to the coach view and there is an alert view consuming all alerts.
If I define a configuration variable for the coach view containing the text input and the alert view, and set the onchange event to bpmext.ui.alert("", tw.local.ConfigMsg); it do not work too.
What's wrong? How should I retrieve a localized string or a local variable in a coach view, in an event code?
Thx,
Laszlo