DataBinding in Royale attempts to be smarter than Flex.  In Flex, there
was one DataBinding implementation that evaluated data bindings in many
different parts of the lifecycle "just-in-case" something might be missed.

In Royale, we are implementing scenario-specific data bindings in order to
optimize data binding evaluation for those scenarios.  For example, there
is an ItemRendererDataBinding that knows that it isn't worth evaluating
the binding until the data property on the renderer is set.

Charts often have renderers and other parts that are handed data at a
particular point.  So you may wish to borrow ItemRendererDataBinding or
use it as inspiration for when your Chart knows it is time to evaluate the
bindings.

Next up is the binding expression itself.   Binding to "{series[0].data}"
has several possible interpretations.  One is that, once set, the value
never changes.  Another is that series could change or new items could
replace what is at 0, or data itself changes.  Each requires more and more
sophisticated change event handling.  But what didn't make sense right
away was that you said series is an ArrayList and ArrayList doesn't have
[0] slots, you have to call getItemAt instead.

Finally, I think you have to type-cast the expression otherwise it won't
minify correctly.  The "data" appears to be an Array, but what are the
items?

I'm done for tonight.  Will check in the morning.

HTH,
-Alex

On 3/26/18, 12:16 AM, "[email protected] on behalf of OmPrakash Muppirala"
<[email protected] on behalf of [email protected]> wrote:

>Okay, I was able to make quite a bit of progress on the ECharts effort.
>The next thing I am stuck on is on how to listen to changes to items in an
>ArrayList.
>This is how the mxml looks like:
>
><ns2:ECharts id="chart">
><ns2:chartOptions>
><ns2:EChartsOptions>
><ns2:title>
><ns2:Title text="My ECharts Title" show="true"
>link="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
>google.com&data=02%7C01%7Caharui%40adobe.com%7C5bddf23a8d4f4e7d4a6408d592e
>a4696%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636576457277211437&sdat
>a=22hoowu75%2FND%2BFIMDe6iWedS2HboxagS6iXLtKAlUb8%3D&reserved=0"
>target="_self" />
></ns2:title>
><ns2:xAxis>
><ns2:XAxis data="{this.data}" position="top" />
></ns2:xAxis>
><ns2:yAxis>
><ns2:YAxis/>
></ns2:yAxis>
><ns2:series>
><js:ArrayList>
><ns2:Series name="Accounts" type="bar" data="{this.seriesData}" />
></js:ArrayList>
></ns2:series>
></ns2:EChartsOptions>
></ns2:chartOptions>
></ns2:ECharts>
>
>
>The databinding on xAxis.data works fine now.  Now I need to make the same
>thing work with series[0].data.
>
>The relevant classes are here:
>EChartsOptions.as:
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
>m%2Fapache%2Froyale-asjs%2Fblob%2F4ae36845c19a923a58f795738b2f428c2615d130
>%2Fexamples%2Froyale%2FECharts%2Fsrc%2Fecharts%2FEChartsOptions.as&data=02
>%7C01%7Caharui%40adobe.com%7C5bddf23a8d4f4e7d4a6408d592ea4696%7Cfa7b1b5a7b
>34438794aed2c178decee1%7C0%7C0%7C636576457277211437&sdata=miFt57IMcqypLMUD
>%2FlmsnTTKPl4tsbUtNNOfg5zHwJk%3D&reserved=0
>
>Series.as:
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
>m%2Fapache%2Froyale-asjs%2Fblob%2F4ae36845c19a923a58f795738b2f428c2615d130
>%2Fexamples%2Froyale%2FECharts%2Fsrc%2Fecharts%2FSeries.as&data=02%7C01%7C
>aharui%40adobe.com%7C5bddf23a8d4f4e7d4a6408d592ea4696%7Cfa7b1b5a7b34438794
>aed2c178decee1%7C0%7C0%7C636576457277211437&sdata=AR%2BepTyqM9T37vbK61no5t
>A9bjGRsHAkgljgmBxxRy8%3D&reserved=0
>
>Any pointers?
>
>Thanks,
>Om
>
>On Fri, Mar 16, 2018 at 9:16 AM, Alex Harui <[email protected]>
>wrote:
>
>> Om appears to be using Express Application, which should have
>> ApplicationDataBinding baked in.  That can be verified in the debugger
>>by
>> checking what is on the strand.
>>
>> Bindings are not evaluated at instantiation time so the destination
>> properties need to handle changing at runtime or the entire component
>> needs to apply all properties at the right time.
>>
>> HTH,
>> -Alex
>>
>> On 3/16/18, 2:35 AM, "Harbs" <[email protected]> wrote:
>>
>> >I’m pretty sure that only works if the view is a separate mxml file.
>> >
>> >> On Mar 16, 2018, at 11:28 AM, Piotr Zarzycki
>> >><[email protected]> wrote:
>> >>
>> >> I'm also wondering whether it will work if he apply
>><js:ViewDataBinding
>> >>/>
>> >> in View only...
>> >>
>> >> 2018-03-16 10:26 GMT+01:00 Harbs <[email protected]>:
>> >>
>> >>> It looks like you are missing <js:ApplicationDataBinding/>
>> >>>
>> >>>> On Mar 16, 2018, at 11:21 AM, OmPrakash Muppirala
>> >>>><[email protected]>
>> >>> wrote:
>> >>>>
>> >>>> Please take a look at these usage examples: [1], [2]
>> >>>>
>> >>>> I am trying to set/bind arrays as values to the chart components.
>>But
>> >>>> those values dont get applied at all.
>> >>>>
>> >>>> Can someone please take a look?
>> >>>>
>> >>>> The entire app can be found here: [3]
>> >>>>
>> >>>> Thanks,
>> >>>> Om
>> >>>>
>> >>>>
>> >>>> [1]
>> >>>>
>> >>>>https://na01.safelinks.protection.outlook.com/?url=
>> https%3A%2F%2Fgithub
>> >>>>.com%2Fapache%2Froyale-asjs%2Fblob%2Ffeature%2F&data=
>> 02%7C01%7Caharui%4
>> >>>>0adobe.com%7Cc0b67f1e7b0b44699adb08d58b21
>> 4cf5%7Cfa7b1b5a7b34438794aed2c
>> >>>>178decee1%7C0%7C0%7C636567897496708478&sdata=
>> zjAObepBqE9V2O8ktwnjs%2F%2
>> >>>>Fpl%2F0J%2FIpj%2B1%2FsCTK%2B6WA%3D&reserved=0
>> >>> echarts/examples/royale/ECharts/src/Main.mxml#L26
>> >>>> [2]
>> >>>>
>> >>>>https://na01.safelinks.protection.outlook.com/?url=
>> https%3A%2F%2Fgithub
>> >>>>.com%2Fapache%2Froyale-asjs%2Fblob%2Ffeature%2F&data=
>> 02%7C01%7Caharui%4
>> >>>>0adobe.com%7Cc0b67f1e7b0b44699adb08d58b21
>> 4cf5%7Cfa7b1b5a7b34438794aed2c
>> >>>>178decee1%7C0%7C0%7C636567897496708478&sdata=
>> zjAObepBqE9V2O8ktwnjs%2F%2
>> >>>>Fpl%2F0J%2FIpj%2B1%2FsCTK%2B6WA%3D&reserved=0
>> >>> echarts/examples/royale/ECharts/src/Main.mxml#L31
>> >>>> [3]
>> >>>>
>> >>>>https://na01.safelinks.protection.outlook.com/?url=
>> https%3A%2F%2Fgithub
>> >>>>.com%2Fapache%2Froyale-asjs%2Fblob%2Ffeature%2F&data=
>> 02%7C01%7Caharui%4
>> >>>>0adobe.com%7Cc0b67f1e7b0b44699adb08d58b21
>> 4cf5%7Cfa7b1b5a7b34438794aed2c
>> >>>>178decee1%7C0%7C0%7C636567897496708478&sdata=
>> zjAObepBqE9V2O8ktwnjs%2F%2
>> >>>>Fpl%2F0J%2FIpj%2B1%2FsCTK%2B6WA%3D&reserved=0
>> >>> echarts/examples/royale/ECharts
>> >>>
>> >>>
>> >>
>> >>
>> >> --
>> >>
>> >> Piotr Zarzycki
>> >>
>> >> Patreon:
>> >>*https://na01.safelinks.protection.outlook.com/?url=
>> https%3A%2F%2Fwww.pat
>> >>reon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com
>> %7Cc0b67f1e7b0b
>> >>44699adb08d58b214cf5%7Cfa7b1b5a7b34438794aed2c178de
>> cee1%7C0%7C0%7C6365678
>> >>97496708478&sdata=B%2FFqHMwrwAGEnorLx5Z4kia4K73rXy
>> RtoTn9kE0xDOg%3D&reserv
>> >>ed=0
>> >>
>> >><https://na01.safelinks.protection.outlook.com/?url=
>> https%3A%2F%2Fwww.pat
>> >>reon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com
>> %7Cc0b67f1e7b0b
>> >>44699adb08d58b214cf5%7Cfa7b1b5a7b34438794aed2c178de
>> cee1%7C0%7C0%7C6365678
>> >>97496708478&sdata=B%2FFqHMwrwAGEnorLx5Z4kia4K73rXy
>> RtoTn9kE0xDOg%3D&reserv
>> >>ed=0>*
>> >
>>
>>

Reply via email to