Re: [FlexJS] Setting background colour at run time fails

2017-02-16 Thread Justin Mclean
Hi, Looks good Peter, I'll give it a try in the next few days and come back with any feedback. Thanks, Justin

Re: [FlexJS] Setting background colour at run time fails

2017-02-16 Thread Peter Ent
Update: I've pushed the following changes: Core package: added StyleChangeNotifier and StyleChange event. StyleChangeNotifier listens for ValueChangeEvents on its strand's style. I decided to park this in Core because it seems listening for style changes would be more universal than just HTML pac

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread Peter Ent
This is what I have at the moment: SolidBackgroundWithChangeListenerBead (extends SolidBackgroundBead) grabs the style from its strand and sets up a listener for ValueChangeEvent. If the style dispatches it, SBWCLB then invokes its super class's methods, setupStyles and handleChange (both of which

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread Alex Harui
On 2/15/17, 10:04 AM, "piotrz" wrote: >Alex, > >Yes settings "style" wouldn't change some style property itself, but will >register couple of times listener - shouldn't we avoid it ? > >What do you mean saying "IMO, styleChangeHandler should be removed from >UIBase." - Where it should be placed

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread Peter Ent
Don’t bother using this code. I spoke with Alex at length about this and I'm going to try a different way. —peter On 2/15/17, 11:25 AM, "Peter Ent" wrote: >Hi, >I just pushed a new bead to the HTML project: >SolidBackgroundWithChangeListenerBead. It is designed to work with >BindableCSSStyles t

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread piotrz
Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Setting-background-colour-at-run-time-fails-tp59273p59452.html Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread Alex Harui
On 2/15/17, 9:44 AM, "piotrz" wrote: >I'm wondering also shouldn't we have in style property condition ? [1] > >[1] https://paste.apache.org/JhUA > IMO, styleChangeHandler should be removed from UIBase. That's just-in-case code. Styles will not always change, and setting a property inside Bi

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread Alex Harui
On 2/15/17, 9:41 AM, "piotrz" wrote: >I'm sorry just added ApplicationDataBinding and it started to work. [1]. >Wouldn't you mind if I remove Bindable property from each properties in >BindableCSSStyles and make one [Bindable] on top of the class ? Sure, as long as it works. I'm pretty sure [

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread piotrz
I'm wondering also shouldn't we have in style property condition ? [1] [1] https://paste.apache.org/JhUA - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Setting-background-colour-at-run-

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread piotrz
otrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Setting-background-colour-at-run-time-fails-tp59273p59447.html Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread piotrz
s message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Setting-background-colour-at-run-time-fails-tp59273p59446.html Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Setting background colour at run time fails

2017-02-15 Thread Peter Ent
Hi, I just pushed a new bead to the HTML project: SolidBackgroundWithChangeListenerBead. It is designed to work with BindableCSSStyles to make change to the background color. Use it like this (SWF or JS): When you want to change the background color of this Contai

Re: [FlexJS] Setting background colour at run time fails

2017-02-14 Thread Peter Ent
Yes, writing a special bead for detecting changes to the styles and applying them does work. I have a SolidBackgroundWithChangeListenerBead that listens for the valueChange event and applies it. It needs some error handling and packaging into the HTML framework so I will do that tomorrow. I will al

Re: [FlexJS] Setting background colour at run time fails

2017-02-14 Thread piotrz
this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Setting-background-colour-at-run-time-fails-tp59273p59404.html Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Setting background colour at run time fails

2017-02-14 Thread Alex Harui
Yes, there are bugs and missing pieces. BindableCSSStyles lets you use binding expressions to detect changes in styles. 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

Re: [FlexJS] Setting background colour at run time fails

2017-02-14 Thread Peter Ent
When you change one of the properties of BindableCSSStyles it dispatches a valueChange event. You need to make a bead, like SolidBackgroundBead (which is SWF only) listen for this event and then redraw itself using the new style(s) that were changed. I am hoping that the JS side "just works" but I

Re: [FlexJS] Setting background colour at run time fails

2017-02-14 Thread piotrz
velopment.2333347.n4.nabble.com/FlexJS-Setting-background-colour-at-run-time-fails-tp59273p59400.html Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Setting background colour at run time fails

2017-02-14 Thread Peter Ent
I had to figure it out as well and looked at FlexJSStore. You use to add this to a component, like a Container: Then you use the id to change it: borderStyles.backgroundColor = "#CC"; I can't get it to work, though. I'm not sure what the "Bindable" part is yet. Doing background

Re: [FlexJS] Setting background colour at run time fails

2017-02-14 Thread piotrz
ening those event ? styleChangeHandler is not used anywhere. Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Setting-background-colour-at-run-time-fails-tp59273p59397.html Sent from the Apache

Re: [FlexJS] Setting background colour at run time fails

2017-02-14 Thread Peter Ent
I'm going to try to incorporate this discussion into the Express package; seems like a great candidate for inclusion there. Peter Ent Adobe Systems/Apache Flex Project On 2/14/17, 12:54 AM, "Alex Harui" wrote: > > >On 2/13/17, 9:40 PM, "Justin Mclean" wrote: > >>Hi, >> >>> IMO, that isn't PAYG

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Alex Harui
On 2/13/17, 9:40 PM, "Justin Mclean" wrote: >Hi, > >> IMO, that isn't PAYG. Container shouldn't need to carry around such >>code >> unless the app developer needs to changes styles at runtime. >> >> Whatever code you needed to make this work should be wrapped up as a >>bead >> so folks can ad

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Justin Mclean
Hi, > IMO, that isn't PAYG. Container shouldn't need to carry around such code > unless the app developer needs to changes styles at runtime. > > Whatever code you needed to make this work should be wrapped up as a bead > so folks can add the code if they need it. OK. Let's say the have a bead

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Alex Harui
On 2/13/17, 5:48 PM, "Justin Mclean" wrote: > >Is there any reason why Container couldn’t have a reapplyStyles method >that calls ValuesManager.valuesImp.applyStyles passing this and >this.style? IMO, that isn't PAYG. Container shouldn't need to carry around such code unless the app developer

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Justin Mclean
Hi, Of course directly calling applyStyles like like means you don't need to use binding at all. http://ns.adobe.com/mxml/2009"; xmlns:js="library://ns.apache.org/flexjs/basic">

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Justin Mclean
Hi, > Do you need a getter if it just gets installed in ValuesManager? I guess not just seems a little inconsistent. Anyway changing the code to this: http://ns.adobe.com/mxml/2009"; xmlns:js="library://ns.apache.org/flexjs/basic" xmlns:beads="org.apache.flex.html.beads.*">

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Alex Harui
On 2/13/17, 4:51 PM, "Justin Mclean" wrote: >Hi, > >> /** >>* @param value The event containing new style properties. >>*/ >> COMPILE::JS >> protected function styleChangeHandler(value:ValueChangeEvent):void >> { >> var newStyle:Object = {}; >>

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Justin Mclean
Hi, > /** >* @param value The event containing new style properties. >*/ > COMPILE::JS > protected function styleChangeHandler(value:ValueChangeEvent):void > { > var newStyle:Object = {}; > newStyle[value.propertyName] = value.newValue; >

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Alex Harui
On 2/13/17, 2:58 PM, "Justin Mclean" wrote: >Hi, > >> A bit more complex for SWFs. JS it should just work. > >So is SolidBackgroundBead the default for a container or do I need to add >it? Default for SWF. It should not be used for JS. The change event from BindableCSSStyles still needs to

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Justin Mclean
Hi, Looks like this issue re not compiling has already been raised: https://issues.apache.org/jira/browse/FLEX-35040 Justin

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Justin Mclean
Hi, > A bit more complex for SWFs. JS it should just work. So is SolidBackgroundBead the default for a container or do I need to add it? Either way for JS it's still not working :-( Tried without adding and the square still fails to turn red. Adding it like so and the project fails to compi

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Alex Harui
On 2/13/17, 2:22 PM, "Justin Mclean" wrote: >Hi, > >> Yep. I think because of PAYG, nobody is watching for the event, so you >> have to add code to wire the event to some code that will re-draw the >> background. And whatever pattern of code that is could go in a new bead >> similar to Layout

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Justin Mclean
Hi, > Yep. I think because of PAYG, nobody is watching for the event, so you > have to add code to wire the event to some code that will re-draw the > background. And whatever pattern of code that is could go in a new bead > similar to LayoutChangeNotifier and be baked into the Express package.

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Alex Harui
On 2/13/17, 1:49 PM, "Justin Mclean" wrote: >Hi, > >> 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. >> >> More verbose, but now the compiler won'

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Justin Mclean
Hi, > 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. > > More verbose, but now the compiler won't let you mis-type fontWeight. > SimpleCSSStyles only con

Re: [FlexJS] Setting background colour at run time fails

2017-02-13 Thread Alex Harui
On 2/12/17, 11:38 PM, "Justin Mclean" wrote: >Hi, > >> 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

Re: [FlexJS] Setting background colour at run time fails

2017-02-12 Thread Justin Mclean
Hi, > 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 watc

Re: [FlexJS] Setting background colour at run time fails

2017-02-12 Thread piotrz
lexJS-Setting-background-colour-at-run-time-fails-tp59273p59287.html Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Setting background colour at run time fails

2017-02-12 Thread Justin Mclean
Hi, >> Also using BindableCSSStyles like so doesn’t change the style box. In >> fact the initial style is not set either. >> >> Is it intended to be used in this way? If so that looks to be a bug to me. > > FlexStore uses BindableCSSStyles. See if that usage pattern works for you. I just did a

Re: [FlexJS] Setting background colour at run time fails

2017-02-12 Thread Alex Harui
On 2/12/17, 10:07 PM, "Justin Mclean" wrote: >Hi, > >Also using BindableCSSStyles like so doesn’t change the style box. In >fact the initial style is not set either. > >Is it intended to be used in this way? If so that looks to be a bug to me. FlexStore uses BindableCSSStyles. See if that usag

Re: [FlexJS] Setting background colour at run time fails

2017-02-12 Thread Justin Mclean
Hi, Also using BindableCSSStyles like so doesn’t change the style box. In fact the initial style is not set either. Is it intended to be used in this way? If so that looks to be a bug to me. http://ns.adobe.com/mxml/2009"; xmlns:js="library://ns.apache.org/flexjs/basic">

Re: [FlexJS] Setting background colour at run time fails

2017-02-12 Thread Justin Mclean
Hi, > [1] > http://apache-flex-development.247.n4.nabble.com/FlexJS-Applying-styles-td56104.html#a56120 Thanks for that, that’s unfortunate. I think both Flex and JS developers are going to run into that as they expect to be able to modify styles at runtime, in particular for simple UI cha

Re: [FlexJS] Setting background colour at run time fails

2017-02-12 Thread yishayw
See this [1] discussion. [1] http://apache-flex-development.247.n4.nabble.com/FlexJS-Applying-styles-td56104.html#a56120 -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Setting-background-colour-at-run-time-fails-tp59273p59277.html Sent from

[FlexJS] Setting background colour at run time fails

2017-02-12 Thread Justin Mclean
Hi, Any reason this may fail (ie the box isn’t turned form black to red) when clicking on the button? I can see that parseStyles is working correctly and returning {background-color: "red”} and I can see that a stylesChanged event is being dispatched. Is it a bug or is there another way you a