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

RowList reverts change of focus when changing row title

I started with Simple_Grid_and_Video.zip
In GridScreen.brs, I changed the OnItemFocused() to update the title of the currently selected row in the rowList to the title of the focused item:

        focusedContent = m.top.content.getChild(itemFocused[0]).getChild(itemFocused[1])

if focusedContent <> invalid then
+ rowX = m.rowList.content.getChild(itemFocused[0])
+ rowX.title = focusedContent.title

'set focused content to top interface
m.top.focusedContent = focusedContent


The issue: when I change the selected item in a row, the title changes, but the selection "jumps back" to the previously selected item.
So say I start the app, I see the first item title in the row title "Live Gaming", but if I hit the right arrow once, the title changes to "Let's Get Cookin'", but the selection quickly goes back to the first item (Twitch)... What is happening?

This seems to occur every time the rowX.title changes; if I just change it to a constant string, it doesn't do it, and if I try to change it to show the index of the selected item in the row (itemFocused[1]), then it does the same thing.

Thanks.
0 Kudos
3 REPLIES 3
TheEndless
Channel Surfer

Re: RowList reverts change of focus when changing row title

Do you have an observer set up anywhere else that could be triggered when you update m.top.focusedContent?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
gboudreau
Channel Surfer

Re: RowList reverts change of focus when changing row title

Indeed, I think this here gets triggered when row.title changes:
Sub OnChangeContent()
? "OnChangeContent "
m.AlbumsGridScreen.setFocus(true)
m.loadingIndicator.control = "stop"
End Sub

Thanks.
0 Kudos
TheEndless
Channel Surfer

Re: RowList reverts change of focus when changing row title

How about an observer on RowList.content? If not, it sounds like changing the row title is causing it to reset focus. If that's the case, then you could grab the current itemFocused before updating the title, then call jumpToRowItem immediately after updating the title.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos