Yes, there are bugs and missing pieces.

BindableCSSStyles lets you use binding expressions to detect changes in
styles.

<js:LayoutChangeNotifier watchedProperty="{borderStyles.borderColor}"
initialValue="#FFFFFF" />
<js:style>

  <js:BindableCSSStyles id="borderStyles" borderColor="#FFFFFF" />
</js:style>

BindableCSSStyles emits binding events when a value changes.  Then you
have to trigger the right reaction to the event.

In FlexJSStore, there is a LayoutChangeNotifier hooked up to re-layout if
borderColorChanges.  But for backgroundColor, a layout doesn't refresh the
backgroundColor.  So we need another bead that can detect the changes and
do the right thing as discussed upthread.  I think a call to applyStyles
is needed, especially on the JS side and on the SWF side the
BackgroundBead needs to be notified.

-Alex

On 2/14/17, 1:31 PM, "Peter Ent" <p...@adobe.com> wrote:

>I had to figure it out as well and looked at FlexJSStore. You use
><js:style> to add this to a component, like a Container:
>
><js:style>
>        <js:BindableCSSStyles id="borderStyles" borderStyle="solid"
>borderWidth="1"
>                               borderColor="#FFFFFF"
>backgroundColor="#FFFFFF"/>
></js:style>
>
>
>Then you use the id to change it: borderStyles.backgroundColor =
>"#CCCCCC";
>
>I can't get it to work, though.
>
>I'm not sure what the "Bindable" part is yet. Doing
>backgroundColor="{someColor}" doesn't do an initial set either. There must
>be a bug.
>
>‹peter
>
>On 2/14/17, 3:52 PM, "piotrz" <piotrzarzyck...@gmail.com> wrote:
>
>>I'm reading and reading this thread and still cannot understand how
>>actually
>>BindableCSSStyles should be used ? Can someone show me working example ?
>>
>>Another thing let say that I have this working example -
>>BindableCSSStyles
>>emits ValueChange event and how it is possible that UIBase is listening
>>those event ? styleChangeHandler is not used anywhere.
>>
>>Piotr
>>
>>
>>
>>-----
>>Apache Flex PMC
>>piotrzarzyck...@gmail.com
>>--
>>View this message in context:
>>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Setting-backg
>>r
>>ound-colour-at-run-time-fails-tp59273p59397.html
>>Sent from the Apache Flex Development mailing list archive at Nabble.com.
>

Reply via email to