Yes, in theory.
The key to debugging binding in Royale is: "don't trust anything" __
The compiler might be generating the wrong code, the widgets may not be
dispatching change events, and also, Royale evaluates binding expressions only
once at instantiation time whereas Flex tried at least twice and sometimes
more, which is the main reason why Flex binding was so slow.
Fundamentally, Binding after instantiation is all about change events. You can
speculate all you want, but I think you are better served by learning how to
debug it. But first, make sure you can convince yourself that the changes that
are happening will dispatch change events. Arrays and Objects and other
primitives do not dispatch change events. Once you've convinced yourself of
that, I recommend setting breakpoints in the debugger. Below are places to
look.
The compiler must find your binding and output it in the _bindings array in the
class that represents the top-tag in your MXML file.
So stop in the debugger and check there.
Then, there must be a Binding implementation bead (ContainerDataBinding or
similar). Check the _beads array (which is the strand and not the "beads"
array which is where you put in custom beads. Note the leading underscore) to
make sure the Binding implementation got loaded.
Then, there must be a triggering event that tells the Binding implementation to
evaluate the _bindings array and set up bindings.
Then, the Binding implementation will generate instances of Bindings
(SimpleBinding, ConstantBinding, GenericBinding, etc). These instances replace
the PropertyWatchers in Flex and end up on strands (the _beads array ) in the
main class or on the component it is watching.
Those Bindings will evaluate the expression and set up change event listeners
if needed.
(Now you can see why explicitly putting in Bindings on strands is more
efficient than the compiler doing it for you from {} expressions)
Once all of that is set up, something has to change and dispatch the right
change event, which should cause the Binding code to run.
It isn't fun, but it should be straightforward to debug. In fact, I am about
to debug one in RemoteObject code.
FWIW, another approach is to actually use Flex to create a similar scenario and
make sure your bindings work there. Then when you debug the Royale version you
might have a better idea of what changes you are looking for.
HTH,
-Alex
On 10/8/18, 1:18 PM, "Carlos Rovira" <[email protected]> wrote:
Just to be sure: someClass is Bindable at level class, and collectionOfVOs
is not marked as Bindable since the class already is. I suppose this works
like in Flex right ? if the Class is Bindable, all members are Bindable
right?
El lun., 8 oct. 2018 a las 22:15, Carlos Rovira (<[email protected]>)
escribió:
> Hi,
>
> just uploaded a example that works, I mean, it seems the component is ok,
> but something is making it to fail. What scares me is that I'm doing
mostly
> the same but across multiple files and pulling data from AMF. I'll
> investigate more to see what could be happening
>
> thanks for the suggestions.
>
> Carlos
>
>
>
> El lun., 8 oct. 2018 a las 22:08, Carlos Rovira
(<[email protected]>)
> escribió:
>
>> Hi Piotr,
>>
>> Jewel ComboBox uses DataItemRendererFactoryForCollectionView that
>> implements IDataProviderItemRendererMapper
>> thanks
>>
>> El lun., 8 oct. 2018 a las 21:02, Piotr Zarzycki (<
>> [email protected]>) escribió:
>>
>>> Hi Carlos,
>>>
>>> Maybe your ComboBox have to use IDataProviderItemRendererMapper ? It's
>>> just
>>> a shot.
>>>
>>> Piotr
>>>
>>> On Mon, Oct 8, 2018, 8:24 PM Alex Harui <[email protected]>
>>> wrote:
>>>
>>> > How can collectionOfVOs be a Constant when it is being assigned data
>>> off a
>>> > network request?
>>> >
>>> > -Alex
>>> >
>>> > On 10/8/18, 11:19 AM, "Carlos Rovira" <[email protected]>
>>> wrote:
>>> >
>>> > When I say this is not working, I mean, I have the data right in
>>> > place, but
>>> > the data provider is empty.
>>> >
>>> > El lun., 8 oct. 2018 a las 20:17, Carlos Rovira (<
>>> > [email protected]>)
>>> > escribió:
>>> >
>>> > > Hi,
>>> > >
>>> > > I'm retrieving a collection of VOs and storing in a class
>>> > >
>>> > > something like this
>>> > >
>>> > > someClass.collectionOfVOs = new ArrayList (event.data as Array);
>>> > >
>>> > > in the screen code I have:
>>> > >
>>> > > <j:ComboBox selectedIndex="0">
>>> > > <j:beads>
>>> > > <js:ConstantBinding sourceID="someClass"
>>> > >
>>> sourcePropertyName="collectionOfVOs"
>>> > >
>>> > destinationPropertyName="dataProvider"/>
>>> > > </j:beads>
>>> > > </j:ComboBox>
>>> > >
>>> > > or I could have directly
>>> > >
>>> > > <j:ComboBox dataProvider="{someClass.collectionOfVOs}">
>>> > >
>>> > > I have setup
>>> > >
>>> > > <js:ContainerDataBinding/>
>>> > >
>>> > > But this is not working, I suppose this is due to a complete
>>> > reassignment
>>> > > of the dataProvider.
>>> > >
>>> > > I think this worked in Flex, if I can recall right.
>>> > >
>>> > > Can someone post some solution for this or let me know if see
>>> some
>>> > > problems in the way I'm creating this?
>>> > > Maybe I'm missing something?
>>> > >
>>> > > thanks
>>> > >
>>> > >
>>> > > --
>>> > > Carlos Rovira
>>> > >
>>> >
>>>
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C9bb473b06f4c4c530d6408d62d5b2406%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636746266805013360&sdata=ULLedzq7cXhkwZ1QCiRdHxM4RaT2iFy5PFyXztdLrjQ%3D&reserved=0
>>> > >
>>> > >
>>> >
>>> > --
>>> > Carlos Rovira
>>> >
>>> >
>>>
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C9bb473b06f4c4c530d6408d62d5b2406%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636746266805023366&sdata=PE%2BFv2fLtarPvLpmfUCsGZZa2AD3Q0MH220alOTWrl4%3D&reserved=0
>>> >
>>> >
>>> >
>>>
>>
>>
>> --
>> Carlos Rovira
>>
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C9bb473b06f4c4c530d6408d62d5b2406%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636746266805023366&sdata=PE%2BFv2fLtarPvLpmfUCsGZZa2AD3Q0MH220alOTWrl4%3D&reserved=0
>>
>>
>
> --
> Carlos Rovira
>
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C9bb473b06f4c4c530d6408d62d5b2406%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636746266805023366&sdata=PE%2BFv2fLtarPvLpmfUCsGZZa2AD3Q0MH220alOTWrl4%3D&reserved=0
>
>
--
Carlos Rovira
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C9bb473b06f4c4c530d6408d62d5b2406%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636746266805023366&sdata=PE%2BFv2fLtarPvLpmfUCsGZZa2AD3Q0MH220alOTWrl4%3D&reserved=0