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: 
MassimilianoBG
Binge Watcher

Grid row cell not updated

Jump to solution

Good day to everyone...

Being disabled and ill is not a condition that helps, especially when you have to deliver a TV app within a few days for one of the largest radio stations in the world.

That said, if anyone can give me a hand...

In the following code, at some point I delete the last cell of the first row in the GridView...

Unfortunately, it doesn’t work. The second cell of the first row is still selectable...

I don’t know. Help!

if trovato$ = ""
            contentNode = m.top.content
            if contentNode <> invalid
                riga = contentNode.GetChild(0)
                if riga <> invalid
                    numero = riga.getChildCount()
                    if numero = 2
                        riga.RemoveChild(1)
                    end if
                end if
                contentNode.Update({ children: riga })
            end if
            m.top.content = contentNode
        end if

        
        ' set up a root ContentNode to represent rowList on the GridScreen
        contentNode = m.top.content
        if contentNode = invalid
            contentNode = CreateObject("roSGNode", "ContentNode")
        end if
        contentNode.Update({
            children: rootChildren
        }, true)
        ' populate content field with root content node.
        ' Observer(see OnMainContentLoaded in MainScene.brs) is invoked at that moment
        m.top.content = contentNode

 

0 Kudos
1 Solution

Accepted Solutions
MassimilianoBG
Binge Watcher

Re: Grid row cell not updated

Jump to solution

Basically, the gridview is displayed with two cells in the first row. However, in debug, you can see that it's actually only one...

Am I forgetting to do something?"

0    pkg:/source/main.brs(52)                       msg = wait(0, m.port)
 1*   ...asks/MainContentTaskLogic.brs(21)    STOP
 2[u] ??
  *selected   [u]unattached(not debuggable)

Brightscript Debugger> t
022:         content = m.mainContentTask.content 

Brightscript Debugger> t
023:         if content <> invalid and content.count() > 1 then 

Brightscript Debugger> t
024:             ilfiglio = content.GetChildren(1,0)

Brightscript Debugger> t
025:             ifiglidelfiglio = content.GetChildren(1,0)
Thread selected:  1*   ...asks/MainContentTaskLogic.brs(25)               ifiglidelfiglio = content.GetChildren(1,0)

Brightscript Debugger> t
026:             ilfigliodelfiglio = ifiglidelfiglio[0]

Brightscript Debugger> p ilfigliodelfiglio
<Component: roSGNode:ContentNode> =
{
    change: <Component: roAssociativeArray>
    focusable: false
    focusedChild: <Component: roInvalid>
    id: "live"
    description: ""
    title: ""
}

Brightscript Debugger> p ifiglidelfiglio[1]    
invalid

Brightscript Debugger> 

 

View solution in original post

0 Kudos
2 REPLIES 2
MassimilianoBG
Binge Watcher

Re: Grid row cell not updated

Jump to solution

Basically, the gridview is displayed with two cells in the first row. However, in debug, you can see that it's actually only one...

Am I forgetting to do something?"

0    pkg:/source/main.brs(52)                       msg = wait(0, m.port)
 1*   ...asks/MainContentTaskLogic.brs(21)    STOP
 2[u] ??
  *selected   [u]unattached(not debuggable)

Brightscript Debugger> t
022:         content = m.mainContentTask.content 

Brightscript Debugger> t
023:         if content <> invalid and content.count() > 1 then 

Brightscript Debugger> t
024:             ilfiglio = content.GetChildren(1,0)

Brightscript Debugger> t
025:             ifiglidelfiglio = content.GetChildren(1,0)
Thread selected:  1*   ...asks/MainContentTaskLogic.brs(25)               ifiglidelfiglio = content.GetChildren(1,0)

Brightscript Debugger> t
026:             ilfigliodelfiglio = ifiglidelfiglio[0]

Brightscript Debugger> p ilfigliodelfiglio
<Component: roSGNode:ContentNode> =
{
    change: <Component: roAssociativeArray>
    focusable: false
    focusedChild: <Component: roInvalid>
    id: "live"
    description: ""
    title: ""
}

Brightscript Debugger> p ifiglidelfiglio[1]    
invalid

Brightscript Debugger> 

 

0 Kudos
MassimilianoBG
Binge Watcher

Re: Grid row cell not updated

Jump to solution

The root cause of my problems is the lack of time. The app (or channel) was created by a colleague of mine who is no longer here, and I found myself managing 5 apps (Android TV, Android Mobile, Apple Mobile, Apple TV, Amazon Firestick) and also the Roku channel...
In the end, with patience and using some of my free time, I managed to understand how to use roAssociativeArray and roArray.
Anyway, I solved it.

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.