enyo.kind({ name: 'MyApplication', kind: 'enyo.Application', view: 'MainView', thing: 1 }); enyo.kind({ name: 'MainView', test: 1, components: [ {name: 'foo', kind: 'MyFoo'}, {name: 'bar', kind: 'MyBar'}, {name: 'foobar', kind: 'MyFooBar'}, {name: 'content', kind: 'enyo.ViewController', resetView: true} ] }); enyo.kind({ name: 'SubView1', components: [ {name: 'number', kind: 'enyo.Input'} ] }); SubView2 SubView3 etc... enyo.kind({ name: 'MyFoo', prop: 1, components: [ {name: 'stuff', content: 'stuff'} ] }); MyBar MyFooBar etc...What I'm trying to do is make a binding in MainView.foo like so:
bindings: [ {from: 'app.view.test', to: '$.stuff.content'} ]What I get is 'undefined' when I should get '1'.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
@dmikeyanderson Not quite understanding what is "at odds" about the binding. I always thought that referencing things like "parent" was considered poor form. Doesn't enyo.Application pass down a reference "app" precisely for this reason? The component would not be relocatable if I created the binding any other way? Also though I may be in the "MainView", I'm acutally in a sub-view of a view controller owned by the main-view. This would mean a binding like 'parent.parent.$.foo' wouldn't it?
In the end I guess I'm confused. I thought the entire purpose and ability of bindings was to do exactly this. enyo.getPath takes a string. Things like model controllers proxy the values of the model and bindings can be created even if the model property of the controller is 'null'. I figured that a view controller acted as a proxy in a similar way.
What is suggested to achieve a binding from a component of a view, through a different ViewController to a component of a view for that controller?