"EnTerr" wrote:
Ok, so back to your original approach:
"btpoole" wrote:
data=m.ContentTaskp.getChildren(1e4, 0)
for each item in data
?item
end for
I believe what you were missing was m.ContentTaskp.content.getChildren():
data = m.ContentTaskp.content.getChildren(1e4, 0)
for each item in data
? item
end for
I.e. you were looking at the children of task and it had no children, instead should been the content field of the task. Both are nodes, so confusion may happen
I am truly sorry for the frustration I have caused on this topic. Let me reset and see if this helps.
The task consist of with some irrelevant code left out. This works.
<component name = "ContentReader_P" extends = "Task" >
<interface>
<field id = "Content" type = "node" />
</interface>
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.functionName = "readcontent"
end sub
Function readcontent() as object
Content = CreateObject("roSGNode", "ContentNode")
for each item in result
data = Content.createChild("ContentNode")
data.addFields ({result: item})
?data
end for
m.top.content=data
end Function
]]>
Back in the brs code I have the following
sub setGridcontent()
data=m.ContentTaskp.content.result
for each item in data
?item
end for
end sub
The ?item gives me each field name in the
m.ContentTaskp.content.result (field names are channel, show, url). I have tried the getchildren(1e,0) as you posted but return invalid. The only way I could get back anything is from what I have posted here. So, for example, if one of the fields in the m.ContentTaskp.content.result is called channel, how would the value of the channel field be obtained? From what I see the "result" is a roAssociativeArray component part of the rosgnode.