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: 
btpoole
Channel Surfer

roListScreen contentList

Can somebody show me a simple example of how to set the roListScreen contentList using an array. The array contains title and url. I just want the roListScreen to show all of the titles it contains but for some reason I only get the last one.
Thanks in advance
0 Kudos
4 REPLIES 4
EnTerr
Roku Guru

Re: roListScreen contentList

You likely fell for this viewtopic.php?f=34&t=75278&p=460250#p460250
Give example code so someone can spot the issue.
0 Kudos
btpoole
Channel Surfer

Re: roListScreen contentList

Here is the code, I only get the last title in the file to show on the screen.

textArr=CreatePlaylistText()
for each title in textArr
contentList = [

{
Title: title,

},

]
next

return contentList
0 Kudos
RokuMarkn
Visitor

Re: roListScreen contentList

You're setting contentList to a single-item array multiple times. contentList never has more than one element in it. This is what you want to do:


contentList = []
for each title in textArr
contentList.Push( { Title: title } ]
next
0 Kudos
btpoole
Channel Surfer

Re: roListScreen contentList

Thanks again, works like it should.
0 Kudos