0

I have some data coming from a backend, I want the backend data to be displayed dynamically in a label widget. How can I set the value of a label through code?

a2800276
  • 3,272
  • 22
  • 33
developer
  • 92
  • 7

1 Answers1

0

You can set your label using curly brackets with the element index you want to use. The array should be provided from the resolverFunction you set.

Here's an example:

    <view id="Animal.selectView" label="{0} details - {1}" resolverClass="application.AnimalHandler" resolverFunction="resolveAnimalLabel">


    resolveAnimalLabel : function() {
        var animalLabel = 'Rhino';
        var anyOtherInfo = 'blah';
        return [animalLabel, anyOtherInfo];

    }
vaffonso
  • 41
  • 1