gboudreau
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2016
12:41 PM
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:
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.
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.
3 REPLIES 3

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2016
01:15 PM
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
gboudreau
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2016
03:18 PM
Re: RowList reverts change of focus when changing row title
Indeed, I think this here gets triggered when row.title changes:
Thanks.
Sub OnChangeContent()
? "OnChangeContent "
m.AlbumsGridScreen.setFocus(true)
m.loadingIndicator.control = "stop"
End Sub
Thanks.

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2016
03:23 PM
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)