/* below, 'arr' is my associative array */
genreList = [i]createObject[/i]("RoSGNode","LabelList")
ContentNode_object = [i]createObject[/i]("RoSGNode","ContentNode")
[b]for[/b] [b]each[/b] key [b]in[/b] arr
ContentNode_child_object = ContentNode_object.createChild("ContentNode")
ContentNode_child_object.field_name = arr[key]
end for
<LabelList
id = "GenreList"
translation = "[160,92]"
itemSize = "[440,48]" >
<ContentNode id = "genremenucontent" role = "content" >
<ContentNode title = "sports" />
<ContentNode title = "music" />
<ContentNode title = "history" />
<ContentNode title = "documentaries" />
</ContentNode>
</LabelList>
<Component: roSGNode:LabelList> =
{
color: -572662273
focusedColor: 640034559
focusedFont: <Component: roSGNode:Font>
font: <Component: roSGNode:Font>
textHorizAlign: "left"
textVertAlign: "top"
animateToItem: -1
columnSpacings: <Component: roArray>
columnWidths: <Component: roArray>
content: <Component: roInvalid>
currFocusColumn: -1
currFocusFeedbackOpacity: 1
currFocusRow: -1
currFocusSection: -1
drawFocusFeedback: true
drawFocusFeedbackOnTop: false
fadeFocusFeedbackWhenAutoScrolling: false
fixedLayout: false
focusBitmapBlendColor: -1
focusBitmapUri: ""
focusColumn: <Component: roArray>
focusFootprintBitmapUri: ""
focusFootprintBlendColor: -1
focusRow: <Component: roArray>
horizFocusAnimationStyle: "floatingfocus"
horizFocusDirection: "none"
itemClippingRect: <Component: roAssociativeArray>
itemFocused: -1
itemSelected: -1
itemSize: <Component: roArray>
itemSpacing: <Component: roArray>
itemUnfocused: -1
jumpToItem: -1
numColumns: 1
numRenderPasses: 3
numRows: 12
rowHeights: <Component: roArray>
rowSpacings: <Component: roArray>
scrollingStatus: false
sectionDividerBitmapUri: ""
sectionDividerFont: <Component: roSGNode:Font>
sectionDividerHeight: 40
sectionDividerLeftOffset: 0
sectionDividerMinWidth: 117
sectionDividerSpacing: 10
sectionDividerTextColor: -572662273
sectionDividerTopOffset: 0
sectionDividerWidth: 0
vertFocusAnimationStyle: "fixedfocuswrap"
vertFocusDirection: "none"
wrapDividerBitmapUri: ""
wrapDividerHeight: 24
wrapDividerLeftOffset: 0
wrapDividerWidth: 0
childRenderOrder: "last"
clippingRect: <Component: roAssociativeArray>
enableRenderTracking: true
inheritParentOpacity: true
inheritParentTransform: true
muteAudioGuide: false
opacity: 1
renderPass: 0
renderTracking: "none"
rotation: 0
scale: <Component: roArray>
scaleRotateCenter: <Component: roArray>
translation: <Component: roArray>
visible: true
change: <Component: roAssociativeArray>
focusable: true
focusedChild: <Component: roInvalid>
id: ""
}
<LabelList
id = "GenreList"
translation = "[160,92]"
itemSize = "[440,48]" >
<ContentNode id = "genremenucontent" role = "content" >
<ContentNode title = "sports" />
<ContentNode title = "music" />
<ContentNode title = "history" />
<ContentNode title = "documentaries" />
</ContentNode>
</LabelList>
"lisakb140" wrote:
...
My code is:
genreList = createObject("RoSGNode","LabelList")
ContentNode_object = createObject("RoSGNode","ContentNode")
for each key in arr
ContentNode_child_object = ContentNode_object.createChild("ContentNode")
ContentNode_child_object.field_name = arr[key]
end for
genreList.content = ContentNode_object
ContentNode_child_object.title = key
genreList.content = ContentNode_object
Disregarding the second issue I wanted to emphasize how the above line of code effectively solved the issue for me as well.
If you are looking to populate a list, such as a CheckList or perhaps a RadioButtonList, and nothing is showing up this very well could be the issue.
Thank you Roku Employee for pointing this obscure nomenclature out. I thought createChild or appendChild would have been the answer, but I was 100% wrong.
I just spent 12 hours trying to figure this out. Used every trick in the book. Very frustrating. The lack of programming usable Brightscript documentation (and worth while examples) certainly is a limiting factor on the number of programmers creating for Roku and it really needs to be addressed.