btpoole
9 years agoChannel Surfer
rsgNode & Task
Is it possible to pass the rsgNode to a task? I have a rgsnode for a grid that is populated by a parse that has to be executed in a task. The code is not actually in the task but is in a function included in the task. Part of the function references the rsgNode of the grid for such things as column widths, itemfocus and others, The code looks something like the following. I need to finda a way to pass the m.programmarkupgrid to the task to be referenced in the function. I can't just run the function without execution timeout. Thanks for any help
step1.brs
mytask.xml
step1.brs
function prearray()
m.ContentTask_preslot = createObject("RoSGNode","GridContent")
m.ContentTask_preslot.array1=m.array1data
m.ContentTask_preslot.array2=m.array2data
m.ContentTask_preslot.array3=m.array3data
m.ContentTask_preslot.ObserveField("state", "pre_grid")
m.ContentTask_preslot.control = "RUN"
end function
function setGridContent()
?"in setGridContent--"
m.array1=m.top.array1
m.array2=m.top.array2
m.array3=m.top.array3
gridx=1
rows=0
temp=[]
m.programmarkupgrid.numColumns= m.array3
?"NUMBER OF COLUMNS>>>>>>>>>>>>>>>>>>>>>>>>> "m.programmarkupgrid.numColumns
for i = 0 to m.programmarkupgrid.numColumns
temp[i]=312
end for
m.programmarkupgrid.columnwidths=temp
end function
mytask.xml
<?xml version="1.0" encoding="UTF-8"?>
<component name="GridContent" extends="Task">
<interface>
<field id = "array1" type = "roArray" />
<field id = "array2" type = "roArray" />
<field id = "array3" type = "roArray" />
</interface>
<script type="text/brightscript" uri="pkg:/source/step1.brs" />
<script type="text/brightscript">
<![CDATA[
sub init()
m.top.functionName = "taskRun"
end sub
function taskRun() as void
?"in GridContent Task"
setGridContent()
end Function
]]>
</script>
</component>