flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [FlexJS] Setting background colour at run time fails
Date Mon, 13 Feb 2017 15:56:25 GMT

On 2/12/17, 11:38 PM, "Justin Mclean" <justin@classsoftware.com> wrote:

>> Raise a jira for Bindable - I will try to look into that.
>Here you go https://issues.apache.org/jira/browse/FLEX-35265
>> What's the difference between BindableCSSStyles to ContainerDataBinding
>Code is very different looks like BindableCSSStyles just specifies the
>list of styles to watch for, where as ContainerDataBinding does all of
>the actually binding work.

The XXXDataBinding classes handle the {} data binding statements in MXML.
They set up watchers and binding instances that react to change events,
which are the key piece in data binding.

A string like styles="fontWeight:bold" is difficult to watch for changes.
Plus it is not structured data: the compiler will not catch me when I
mistype style="fontWieght:bold".  So, and hopefully FlexJSStore
illustrates this, there is a SimpleCSSStyles class that is structured so
in MXML you use it like:

      <js:SimpleCSSStyles fontWeight="bold" />

More verbose, but now the compiler won't let you mis-type fontWeight.
SimpleCSSStyles only contains the most common styles I could think of.
Folks can create their own versions for their own purposes.  However,
these classes are, because of PAYG, simple bags of properties and do not
dispatch change events.  BindableCSSStyles dispatches change events.


View raw message