Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
neowinston
Visitor

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!
Tags (1)
0 Kudos
3 REPLIES 3
tim_beynart
Channel Surfer

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
Tags (1)
0 Kudos
neowinston
Visitor

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

Thank you, Tim! You helped me a lot!
Tags (1)
0 Kudos
ackmanx
Visitor

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.
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!