:origin()/pre09/5c9d/th/pre/i/2015/261/4/8/windows95programsicon_by_scorpiongamer01-d9a1oi6.png)
mape
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2017
12:58 AM
Passing data to the component
Hello everybody.
I'm novice to Roku and BrightScript, so, my question in very simple.
How to pass some data to the component? What is regular way to it?
The constructor, init() method, can't has any parameters.
This page https://sdkdocs.roku.com/display/sdkdoc/Component+Functions says that component can gave only two built-in methods. Really? Is so, I can't add my own methods.
I had dig in the documentation and samples, but didn't find the answer.
I'm novice to Roku and BrightScript, so, my question in very simple.
How to pass some data to the component? What is regular way to it?
The constructor, init() method, can't has any parameters.
This page https://sdkdocs.roku.com/display/sdkdoc/Component+Functions says that component can gave only two built-in methods. Really? Is so, I can't add my own methods.
I had dig in the documentation and samples, but didn't find the answer.
3 REPLIES 3
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2017
07:54 AM
Re: Passing data to the component
The component must specify <interface> elements.
To pass data to a component, set the interface value for that component.
To read data passed to it, the component uses an observer to listen for changes to its interface field.
To pass data to a component, set the interface value for that component.
To read data passed to it, the component uses an observer to listen for changes to its interface field.
:origin()/pre09/5c9d/th/pre/i/2015/261/4/8/windows95programsicon_by_scorpiongamer01-d9a1oi6.png)
mape
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2017
12:25 AM
Re: Passing data to the component
This is too complex way.
I found the 'functional fields'. This is like a regular methods.
But supported only in SDK 7.5, it is suitable.
I found the 'functional fields'. This is like a regular methods.
But supported only in SDK 7.5, it is suitable.
:origin()/pre09/5c9d/th/pre/i/2015/261/4/8/windows95programsicon_by_scorpiongamer01-d9a1oi6.png)
mape
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2017
05:16 AM
Re: Passing data to the component
belltown[/url:3ppr0kg0], I got your idea, thank you.
The chain is:
Preparing:
1. Describe <interface><field> in xml.
2. In the code - set observer to this field.
Invoking:
3. Set some value to the field.
4. Observer automatically invoked.
The chain is:
Preparing:
1. Describe <interface><field> in xml.
2. In the code - set observer to this field.
Invoking:
3. Set some value to the field.
4. Observer automatically invoked.