BPM, Workflow, and Case

 View Only
  • 1.  How to retrieve localized string in a coach view event code?

    Posted Wed May 06, 2020 09:20 AM

    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



  • 2.  RE: How to retrieve localized string in a coach view event code?

    Posted Wed May 06, 2020 03:17 PM
    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
    ------------------------------



  • 3.  RE: How to retrieve localized string in a coach view event code?

    Posted Wed May 06, 2020 03:19 PM
    I see. Many thanks Valentinas!

    ------------------------------
    Laszlo
    ------------------------------