Hi!
I’m trying to make it work the following observable list called listItems:
var steps = [
{ id: "0", caption: "title1",
listItems: [
{ title: "value1", value: "value1" },
{ title: "value2", value: "value2" },
{ title: "value3", value: "value3" }
] },
{ id: "1", caption: "title2",
listItems: [
{ title: "value1", value: "value1" },
{ title: "value2", value: "value2" },
{ title: "value3", value: "value3" }
] }
];
var actualQuestion = Observable(0);
var listItems = Observable(steps[actualQuestion.value].listItems);
var caption = Observable(steps[actualQuestion.value].caption);
questionList.onParameterChanged( function(param) {
actualQuestion.value = param;
})
This is the corresponding template:
...
<BodyText Alignment="CenterLeft" Value="{caption}"/>
...
<Each Items="{listItems}">
<ListItem Title="{title}" Value="{value}" />
</Each>
...
The caption observable works fine, but not the listItem observable. In this case it seems that the UI only sees an empty array. I don’t know where is the error if it in the observable declaration or in the template.
Would appreciate any help.
Thanks