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?
Asked
Active
Viewed 511 times
0
-
What have you already tried? – Oleksandr Tarasenko Dec 16 '15 at 10:20
1 Answers
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
-
Thanks. I would also like to know, how to dynamically set values for a list widget. – developer Dec 18 '15 at 04:17
-
I not able to see any dynamic data displayed in view, I could only see {0}. I have given all mentioned in above code – developer Dec 21 '15 at 05:59
-
Do we have some document on app.xml tags and attribute details.If so could anyone please share. – developer Dec 21 '15 at 12:24
-
-
-
I could see app.xsd in build folder.How ever dynamic label is not reflecting.pls help – developer Dec 22 '15 at 06:31