Binding is really just encapsulation of adding event listeners to things and 
setting other values in that listener.

The different classes like ApplicationDataBinding, ContainerDataBinding, 
ItemRendererDataBinding are mostly the same, but try to specialize around some 
knowledge of what is important to watch for (the appiication's model, or the 
item renderer's data property).

The key pieces are:
- does the thing that is being listened to for changes (the source) actually 
send an event?  Watch out for nested properties that don't propagate an event 
to some parent object.
- is the destination available at the time of that change?

If you stick a breakpoint on the setter that changes, you can step into the 
dispatchEvent and see if there are listeners, and one of them should run some 
binding code, and that should try to set a value in the destination.

I'm pretty sure binding is working for ArrayCollection and some other 
non-visual components.

HTH,
-Alex

On 2/12/20, 12:57 AM, "Harbs" <[email protected]> wrote:

    I was struggling for a long time last night trying to get binding to 
properly work in Router.
    
    I’m able to use Router as an MXML base, so that’s good, but wasn’t able to 
use binding:
    
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Funhurdle%2Fspectrum-royale%2Fblob%2Fmaster%2FSpectrumBrowser%2Fsrc%2Fview%2FBrowserRouter.mxml&amp;data=02%7C01%7Caharui%40adobe.com%7C7b5a506e4cd74472228508d7af998c80%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637170946368601993&amp;sdata=jFw7XQAdIY%2FBoX1IdbZ1sY50ixXlA8Q5CWFDrnC7BtA%3D&amp;reserved=0
 
<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Funhurdle%2Fspectrum-royale%2Fblob%2Fmaster%2FSpectrumBrowser%2Fsrc%2Fview%2FBrowserRouter.mxml&amp;data=02%7C01%7Caharui%40adobe.com%7C7b5a506e4cd74472228508d7af998c80%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637170946368601993&amp;sdata=jFw7XQAdIY%2FBoX1IdbZ1sY50ixXlA8Q5CWFDrnC7BtA%3D&amp;reserved=0>
    
    I tried declaring parent=“{paneHolder}” on the component routes where 
paneHolder was a bindable variable, but the value was never assigned.
    
    I originally had issues with initialization order, but Router is now 
delaying the adding of beads and loading them in an async call to ensure that 
the whole component structure that Router is attached to is already initialized 
when the beads are added.
    
    I never worked on the binding code and I don’t understand the difference 
between the different binding classes. I tried using ContainerDataBinding, but 
that seemed to listen without actually applying the values.
    
    Is there a binding class that can be used, or do we need a new one? Is 
there other things I should know about binding lifecycles?
    
    Thanks,
    Harbs

Reply via email to