estanglerbm opened a new issue #1012:
URL: https://github.com/apache/royale-asjs/issues/1012


   In application code, doing this:
   
   ``mx.binding.utils.BindingUtils.bindProperty(targethost, "targetmember", 
sourcehost, ["sourcemember"]);``
   
   where ``sourcehost.sourcemember`` is ``[Bindable]`` (with or without event 
name) will not produce updates of ``targethost.targetmember``.
   
   The reason is that with the default config .xml file, the ``metadata`` 
showing ``'Bindable'`` is not generated in the .js file, and ChangeWatcher is 
expecting that info:
   
   ```
   mx.binding.utils.ChangeWatcher.watch()
   -> mx.binding.utils.ChangeWatcher.reset()
   -->  mx.binding.utils.ChangeWatcher.getEvents()
   ---> mx.binding.BindabilityInfo.getCachedInfo(host).getChangeEvents(name);
   ----> (first looking at 
mx.binding.BindabilityInfo.childChangeEvents[childName], otherwise looking at 
accessors / variables)
   ----> mx.binding.BindabilityInfo.addBindabilityEvents()
   -----> org.apache.royale.reflection.utils.filterForMetaTags(members, 
['Bindable'])
   -----> mx.binding.BindabilityInfo.addChangeEvents 
   ------> (if found, uses "valueChange" event for default [Bindable], or 
custom event name if specified)
   ```
   
   Under ``ROYALE_REFLECTION_INFO`` in the .js file, it wants to see something 
like this:
   
   ``        'text': { type: 'String', access: 'readwrite', declaredBy: 
'my.awesome.company.MyClass', metadata: function () { return [ { name: 
'Bindable' } ]; }},``
   
   but it's seeing only something like this:
   
   ``        'text': { type: 'String', access: 'readwrite', declaredBy: 
'my.awesome.company.MyClass'},``
   
   The solution is to uncomment the relevant part of the config .xml file, or 
use the compiler option:
   
   ``-compiler.keep-as3-metadata=Bindable``
   
   Where is this prominently documented to help poor application developers 
from spending hours to figure this out?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to