vjani
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2018
04:00 PM
TaskNode callback scope
Hello,
So, just came across a limitation while creating TaskNodes that the callback function registered with observeField is sent as a string, so it has be defined in the component brs file for the owning component and not anywhere else. For example, if my component brs uses other objects that themselves have member functions, there is no way for those member functions to create TaskNodes and listen for events on them as the observeField doesn't take in the scope for the callback. Am I missing something or this is as designed? Because this essentially means that for any component, all Task Nodes and their callbacks have to be defined inside the component brs.
So, just came across a limitation while creating TaskNodes that the callback function registered with observeField is sent as a string, so it has be defined in the component brs file for the owning component and not anywhere else. For example, if my component brs uses other objects that themselves have member functions, there is no way for those member functions to create TaskNodes and listen for events on them as the observeField doesn't take in the scope for the callback. Am I missing something or this is as designed? Because this essentially means that for any component, all Task Nodes and their callbacks have to be defined inside the component brs.