m.save = createObject("roSGNode", "ConfigTask")
m.save.checkedlist = a
m.save.isarray = true
m.save.isdone = false
m.save.observeField("isdone", "closeThis")
m.save.control = "RUN"
<field id = "checkedlist" type = "assocarray" />
a = {
checkedList : [{id: 1, checked: false}, {id: 2, checked: true}]
}
"juantwc" wrote:
If you look here https://sdkdocs.roku.com/display/sdkdoc/interface you will see that the type of array you are trying to pass is not one of the supported types. The choice of supported types is a bit strange to be honest, but i digress.
"ioan" wrote:
... I also tried m.save.checkedlist.Append(a) and to push each element separately, but I always get error. What's the right way to do this?
Python Brightscript
------ ------------
list.append(elm) roArray.push(elm)
list.extend(lst) roArray.append(lst)
"ioan" wrote:
I have this array, a = [{id: 1, checked: false}, {id: 2, checked: true}] and I want to pass it to a task. I tried declaring the interface
<field id = "checkedlist" type = "array" /> or <field id = "checkedlist" type = "assocarray" />
but when I try to assign the a to it, it doesn't work. Here is what I tried:m.save = createObject("roSGNode", "ConfigTask")
m.save.checkedlist = a
...
m.save.addFields({checkedlist: [{id: 1, checked: false}, {id: 2, checked: true}]})
? formatJSON(m.save.checkedlist)
"EnTerr" wrote:
Does it work?