Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chetankj
Visitor

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
6 REPLIES 6
chetankj
Visitor

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
Roku Guru

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 🙂
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
Visitor

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
Roku Guru

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
Visitor

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
WSJTim
Binge Watcher

Re: Unable to create sections in MarkUpList

I hacked (as with most things on Roku) around the issue of item retrieval by also creating and populating a flat version of my content and using that for accessing the data. For example:

sub load()
section = createObject("roSGNode", "ContentNode")
section.contentType = "SECTION"

for each item in items
section.appendChild(node) m.flatContent.appendChild(node.clone(true))
end for

m.markupList.content = section end sub ... sub onItemFocused() selectedNode = m.flatContent.getChild(m.markupList.itemFocused) ... end sub

 

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.