I would like to extend LabelList (component let's name it MyListMenu) in a way that I can reuse some layout settings accros my channel, and specify it's content when used in xml.
What I would like to achieve is an option to specify something like this
<children>
<MyListMenu>
<ContentNode id="menuContent" role="content">
<ContentNode title="Play" />
<ContentNode title="Settings" />
<ContentNode title="Tutorial" />
</ContentNode>
</MyListMenu>
</children>
I have a problem, that I can't find a way to define MyListMenu to handle setting of content and putting it in right place.
My xml for MyListMenu
<component name="MyListMenu" extends="LabelList" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd"
initialFocus="contentGroup"
>
<interface>
<field type="string" id="title" alias="titleLabel.text"/>
<!-- this didn't work, onContentChanged is never triggered-->
<field type="node" id="content" onChange="onContentChanged" alwaysNotify="true"/>
</interface>
<script type="text/brightscript"
uri="pkg:/components/View/Shared/MenuFrame/MenuFrame.brs" />
<children >
<Group translation="[100,200]" >
<Rectangle width="680" height="400" color="0xFF0000FF" />
<Rectangle translation="[15,50]" width="650" height="310" color="0xFFFFFFFF" />
<Label id="titleLabel" width="680" horizAlign="center"/>
<LabelList id="contentGroup" translation="[0,100]" >
<!-- Here I would like to place content set from parent component -->
</LabelList>
</Group>
</children>
</component>
With code above ContentNode is displayed, but I cannot put it into LabelList with id "contentGroup", what is a proper approach to achieve this behavior?