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: 
neowinston
Level 7

How to get the string from a selected item in a LabelList?

I need to get the string from a selected item in a LabelList. From the docs I know that itemSelected gives me the index, but not the string. How do I get the selected string? Thank you!
0 Kudos
3 Replies
tim_beynart
Level 7

Re: How to get the string from a selected item in a LabelList?

I think you need to use the index to look up the value from the LabelList data provider (peudocode, syntax may be wrong)

list.content[index].title
0 Kudos
neowinston
Level 7

Re: How to get the string from a selected item in a LabelList?

Thank you, Tim! You helped me a lot!
0 Kudos
ackmanx
Level 7

Re: How to get the string from a selected item in a LabelList?

For future reference of others, the specific code I had to use for your use case was:

m.setList.content.getChild(m.setList.itemSelected).title

Where m.setList was my LabelList.
0 Kudos