btpoole
10 years agoChannel Surfer
Example of Creating Custom Field in Task
Can somebody post an example of how to create a custom field. I have a task that runs, gets data from server, parses the data. I would like to assign part of the parse to a custom field name but have been unsuccessful in creating the custom field. Just putting it in the interface doesn't seem to do it. I have created an extends of the Task and added the field but I am not sure how to tell the Task an extend exists. I have something like the following:
Extend of Task
<component name = "programContentReader" extends = "Task" >
<interface>
<field id = "content" type = "node" />
<field id = "myfield" type = "string" />
</interface>
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.functionName = "readcontent"
end sub
Function readcontent() as object
content = CreateObject("roSGNode", "ContentNode")
Stuff going on here to parse
dataItem = content.CreateChild("ContentNode")
dataitem.myfield= whatever is in parse
m.topcontent=content
end function
Extend of Task
<component name="extendprogram" extends="ContentNode" >
<interface>
<field id ="myfield" type="string" />
</interface>