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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ButtonGroup Loses Focus

I have a buttongroup list that is overlaying a rowlist but when I move to the end of the list it loses focus to the rowlist somehow.

What could the problem be?
0 Kudos
Roku Guru

Re: ButtonGroup Loses Focus

In your onKeyEvent that controls movement to get to your rowlist you need something like below

if NOT m.buttongroup.hasFocus()

Use this to tell when the buttongroup has focus and in your rowlist movement do not allow the focus back to the rowlist until the press of up/down and the buttongroup isn't focused. When the buttongroup has focus do not allow up/down keypresses to have an effect in your rowlist onKeyEvent.

I assume you use an observer to watch the buttongroup button press. In the call the observer makes you can set focus back on the rowlist after a selection has been made in the buttongroup. Also use the if m.buttongroup.hasFocus() and key = "back" to set focus back on the rowlist and act like cancel (aka no choice made).
0 Kudos