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: 
nmaves
Visitor

Showing a dialog from deep down the component tree.

All of the examples of dialogs are a bit simple.  

When you are deep down the component tree how do you display a dialog?  m.top is not my "scene" component and there for nothing happens when I set m.top.dialog.  

How do I get access to that top level scene node?
0 Kudos
2 REPLIES 2
joetesta
Roku Guru

Re: Showing a dialog from deep down the component tree.

I believe the way to do this is to have a field on the child node that's observed by the parent node.  The parent can then see that field changed and set its own field observed by its own parent to pass it on up to the top, where it would be observed and displayed.
aspiring
0 Kudos
nmaves
Visitor

Re: Showing a dialog from deep down the component tree.

So I found this little bit of code and it worked!

m.top.getScene().dialog = dialog


Though it is only supported in 7.6 and up.  I am not sure how many devices run < 7.5
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.