nmaves
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2017
02:02 PM
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?
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?
2 REPLIES 2
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2017
02:58 PM
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
nmaves
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2017
03:01 PM
Re: Showing a dialog from deep down the component tree.
So I found this little bit of code and it worked!
Though it is only supported in 7.6 and up. I am not sure how many devices run < 7.5
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