Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
chetankj
Level 7

Unable to create sections in MarkUpList

Hi,

Can anybody tell me how to create sections with markupList. I tried creating sections Root child having CONTENTTYPE = "SECTION", it does not work.

Here is the code i tried, which loads the data but does not show Sections
      content = createObject("RoSGNode","ContentNode")
      contentChild0 = content.createChild("ContentNode")
      contentChild1 = content.createChild("ContentNode")
      contentChild2 = content.createChild("ContentNode")

      contentChild0.title = "section1"
      contentChild0.CONTENTTYPE = "SECTION"
      contentChild0.appendChild(CHILDREN OBJECT)
      
      contentChild1.title = "section2"
      contentChild1.CONTENTTYPE = "SECTION"
      contentChild1.appendChild(CHILDREN OBJECT)
      contentChild1.appendChild(CHILDREN OBJECT)

      contentChild2.title = "section3"
      contentChild2.CONTENTTYPE = "SECTION"
      contentChild2.appendChild(CHILDREN OBJECT)

Is this the right way to create sections? Is there anything i am doing wrong?

Thanks
0 Kudos
5 Replies
chetankj
Level 7

Re: Unable to create sections in MarkUpList

I think i found the problem. When i set the vertFocusAnimationStyle = "fixedFoucse" sections does not show up. But when i set the vertFocusAnimationStyle = "fixedFocusWrap" Sections show up.

Can any one at Roku confirm if this is platform issue or something i am not doing right or Sections are only supported with "fixedFocusWrap"?

Thanks
0 Kudos
joetesta
Level 10

Re: Unable to create sections in MarkUpList

"chetankj" wrote:
I think i found the problem. When i set the vertFocusAnimationStyle = "fixedFoucse" sections does not show up. But when i set the vertFocusAnimationStyle = "fixedFocusWrap" Sections show up.

Can any one at Roku confirm if this is platform issue or something i am not doing right or Sections are only supported with "fixedFocusWrap"?

Thanks

if indeed you are using the value "fixedFoucse" then I confirm it is something you are not doing right Smiley Happy
These are the possible values:
floatingFocus
fixedFocusWrap
fixedFocus

Your method of creating sections (your first post) seems fine.  I wouldn't rule out a bug but one this big would probably have been (maybe already is?) mentioned on this forum somewhere.
aspiring
0 Kudos
chetankj
Level 7

Re: Unable to create sections in MarkUpList

Thanks for your reply and sorry about the typo there, i was using "fixedFocus" and it did not work.  Only "fixedFocusWrap" shows the sections in the markup list.

Also how do I get the content Item selected from the list. The "itemSelected" field returns the index of the itemNode, but that itemNode could be a child of different Section Root node. How do i know which Section root was selected to find itemNode in its children.

Currently markupList "itemSelected" just tells me index of the itemNode selected in the list, but does not tell me which Section Root node i have to find it into.

Section 1 ------
Item 0
Item 1

Section 2 -------
Item 2
Item 3

Section 3----------
item 4
item 5

when i click on item 3 in the list, the ItemSelected field is set to index 3 but how do i know that i have to find that node in section 2 at index 1, since its present in RootNode => Section 2 Node => Item 3
0 Kudos
joetesta
Level 10

Re: Unable to create sections in MarkUpList

I think what you should do is when you are creating the (or appending existing) child nodes, tag them with the section they are in at that time by adding a field "sectionId" or some such to each child node so when you find the child node you can reference this field to find its section.  make sense?
aspiring
0 Kudos
BVatBBOD
Level 7

Re: Unable to create sections in MarkUpList

@chetank how did you end up solving this.  I am creating sections but I don't know how to retrieve the content node as I don't know which section or item within that section was selected.

Thanks,
Blake
Join the Roku Developers Slack Workspace for quicker help and great dev collaboration: http://tiny.cc/nrdf0y
0 Kudos