Forum Discussion

vrihlea's avatar
vrihlea
Visitor
8 years ago

CreateNextPanel manually

Is it possible to create a "nextPanel" without 
m.top.ObserveField("createNextPanelIndex", "createNextPanel")


I tried setting it manually with
m.top.hasNext = true
m.top.nextPanel = CreateObject...
m.top.nextPanel.SetFocus(true)


adding it to the PanelSet with AppendChild also doesn't work (https://sdkdocs.roku.com/display/sdkdoc/PanelSet)


are there other ways to hack this ?

4 Replies

  • I faced this issue a couple weeks ago and eventually came onto the solution to replace the contents of each node in the nextPanel.  I found I could not replace the nodes directly because the reference will persist to the previous node.  I had to keep the same nodes in place and just update their contents (text and uri's).  Hope this helps, it was a PITA!!!
    -Joe
  • yes, I thought about reusing the panel, but the issue now is the next panel flickers when going up-down the list... even if I unobserve the createNextPanel event with:
    sub createNextPanel(event as Object)
    m.top.UnobserveField("createNextPanelIndex")


    damn you, DUSKYscript!!!
  • yeah i accepted some screen flicker as the least of several evils 😉
    If you're replacing the contents you'll either need to hide the panel during that update or accept it, I'm afraid.
  • thanks, will have to rethink stuff to make it play along somehow