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: 
arno
Visitor

RowList Node loses focus

Hello!

I'm working on a Roku channel app and encountered a problem that I can't seem to be able to fix.

In the app, I have a PanelSet to which I add a ListPanel and another blank panel that I'm not using yet. 
I have a third panel, CategoriesPanel, that contains a RowList node that is created in the init function. This third panel should appear when I press the "right" button while in the ListPanel. 
This is happening and the first row in the RowList is focused. My problem is, when I go back to the ListPanel from the CategoriesPanel and go back to the CategoriesPanel, the RowList is not being focused anymore and the only thing I can do is go back and forth through the slides without being able to access items in the RowList.

I tried forcing the focus on the RowList but that doesn't seem to work:


sub init()
    m.top.panelSize = "wide"
    m.top.isFullScreen = true
    m.top.focusable = true
    m.top.hasNextPanel = false
    m.top.createNextPanelOnItemFocus = false
    m.CategoriesRowList = createObject("roSGNode", "CategoriesRowList")   
    m.CategoriesRowList.id = "rowList"
    m.CategoriesRowList.SetFocus(true)
    m.top.appendChild(m.CategoriesRowList)
    m.top.observeField("focusedChild", "focusChange")
end sub
    
sub focusChange()
    m.CategoriesRowList.setFocus(true)
    m.CategoriesRowList.jumpToRowItem = [0,0]
end sub  

Am I doing something wrong or should I think of another way to display a RowList when moving to the right in a PanelSet?

Thank you!

EDIT: I managed to fix this. Everything remains the same, except this line "m.CategoriesRowList.jumpToRowItem = [0,0]" from the code above.
The next thing was to do the same thing I did above for my CategoriesRowList component that extends "Group" and that contains a RowList child.

sub init()
    m.top.setFocus(true)
    m.RowList = m.top.findNode("rowList")
    m.top.observeField("focusedChild", "focusChange")
end sub

sub focusChange()
    m.RowList.setFocus(true)
end sub  

Hope this helps anyone.
0 Kudos