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: 
Reel Rookie

Error while using rowList.jumpToItem

So currently I just want to set focus on item in GridScreen after DetailsScreen was closed. I have two rows in GridScreen  with 20 items, when you press OK on items, you will see DetailsScreen, but it is possible to change target item in the DetailsScreen by clicking left/right buttons. So the problem is that when I press "back" in the DetailsScreen, I want my last item i saw in DetailsScreen to be focused on the GridScreen.
I have template HideScreen() method in my HomeScreen 
Sub HideScreen(node as Object)
if node = invalid OR (m.screenStack.peek() <> invalid AND m.screenStack.peek().isSameNode(node))
last = m.screenStack.pop()
prev = m.screenStack.peek()
last.wasClosed = true
last.visible = false
if prev <> invalid
 prev.focusedChild.jumpToRowItem = [0,m.detailsScreen.itemSelectedPosition]
prev.visible = true
end if
end if
End Sub

So when I trying to use prev.focusedChild.jumpToRowItem I get runtime error like this one:
Invalid value for left-side of expression.

Here is prev:

Brightscript Debugger> ?prev
<Component: roSGNode:GridScreen> =
childRenderOrder: "last"
clippingRect: <Component: roAssociativeArray>
enableRenderTracking: false
inheritParentOpacity: true
inheritParentTransform: true
muteAudioGuide: false
opacity: 1
renderPass: 0
renderTracking: "disabled"
rotation: 0
scale: <Component: roArray>
scaleRotateCenter: <Component: roArray>
translation: <Component: roArray>
visible: false
change: <Component: roAssociativeArray>
focusable: false
focusedChild: <Component: roInvalid>
id: "GridScreen"
content: <Component: roSGNode:ContentNode>
focusedContent: <Component: roSGNode:ContentNode>
itemFocused: <Component: roArray>
itemFocusedIndex: <Component: roArray>
rowItemSelected: <Component: roArray>

I also tried to observe and then use GridScreen field and set it onChange m.rowList.jumpToItem =..., but it is not working at all.
What am I doing wrong here?


0 Kudos
Roku Guru

Re: Error while using rowList.jumpToItem

Sounds like a lot to think on..

Why not just use something like:

your itemSelected makes your detail screen visible and have focus and with a key press event set the visibility of your detailScreen to false and then setFocus back to the gridScreen.

Basically like what the video component normal usage is.

0 Kudos