neowinston
9 years agoVisitor
Cannot run Task
I'm trying to run the example from here without success.
Here is the code:
I'm getting this error:
What Am I doing wrong? How do I fix this problem. Thanks for your help!
Here is the code:
m.getHomeOptionsList = createObject("roSGNode", "getLabelListContent")
m.getHomeOptionsList.setField("uri", "http://www.sdktestinglab.com/homeoptionslistcontent.xml")
m.getHomeOptionsList.observeField("content", "showhomeoptionslist")
m.getHomeOptionsList.functionName = "showhomeoptionslist"
m.getHomeOptionsList.control = "RUN"
<?xml version = "1.0" encoding = "utf-8" ?>
<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->
<component name = "getLabelListContent" extends = "Task" >
<interface>
<field id = "uri" type = "uri" />
<field id = "content" type = "node" />
</interface>
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.functionName = "getContent"
end sub
sub getContent()
content = createObject("roSGNode", "ContentNode")
contentxml = createObject("roXMLElement")
readInternet = createObject("roUrlTransfer")
readInternet.setUrl(m.top.uri)
contentxml.parse(readInternet.GetToString())
if contentxml.getName() = "listcontent"
for each item in contentxml.GetNamedElements("item")
attributes = item.getAttributes()
item = {
text: attributes.text
}
listitem = content.createChild("ContentNode")
listitem.title = item.text
end for
end if
m.top.content = content
end sub
]]>
</script>
</component>
I'm getting this error:
BRIGHTSCRIPT: ERROR: roSGNode: Failed to create roSGNode with type getLabelListContent: pkg:/components/screens/DetailsScreen/DetailsScreen.brs(101)
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.
Suspending threads...
Thread selected: 1* ...ailsScreen/DetailsScreen.brs(102) m.getHomeOptionsList.setField("uri", "http://www.sdktestingl
Current Function:
100: sub runXMLTask()
101: m.getHomeOptionsList = createObject("roSGNode", "getLabelListContent")
102:* m.getHomeOptionsList.setField("uri", "http://www.sdktestinglab.com/homeoptionslistcontent.xml")
103: m.getHomeOptionsList.observeField("content", "showhomeoptionslist")
104: m.getHomeOptionsList.functionName = "showhomeoptionslist"
105: m.getHomeOptionsList.control = "RUN"
106: end sub
Interface not a member of BrightScript Component (runtime error &hf3) in [color=#0080e1][u]pkg:/components/screens/DetailsScreen/DetailsScreen.brs(102)
102: m.getHomeOptionsList.setField("uri", "http://www.sdktestinglab.com/homeoptionslistcontent.xml")
What Am I doing wrong? How do I fix this problem. Thanks for your help!