On 3/16/16, 3:30 AM, "santanu4ver" <[email protected]> wrote:

>Alex Harui wrote
>>>3. Passing border styles through 'className' styles never worked in HTML
>>>version (nor in SWF version). This only I able to worked through
>>>
>> <js:SimpleCSSStyles/>
>> . Does border styles through 'className' property is
>>>not supportable?
>> 
>> For a Container?  Or some other component?  Some components have styles
>> defined in defaults.css.  There might be a bug in order of precedence.
>> Border should work as expected so further investigation is needed.
>
>For Container. 

Make sure you are using valid CSS for the border styles.  The Spark and MX
components didn't use valid CSS as values or style names.  If that still
isn't working, then file another JIRA with a simple test case.

>
>
>Alex Harui wrote
>> SimpleCSSStyles also expects the styles won't change.  There is a
>> BindableCSSStyles class that dispatches valueChange events when you
>>change
>> the style properties.  Your new version of SolidBackgroundBead may want
>>to
>> check for changes there as well.  Similar work is needed for
>> SingleLineBorderBead.
>
>How this BindableCSSStyles works? Is there any working example/codes
>against
>this that I can follow? So far I tried these but nothing worked out:
>
>/<js:Container id="cont" width="20%" height="100%">
>       <js:style>
>               <js:BindableCSSStyles id="bcss" borderStyle="solid" 
> borderWidth="2"
>borderColor="#ffffff" backgroundColor="#0000ff"/>
>               </js:style>
>       <js:Label text="3"/>
></js:Container>/

There is an example in
examples/flexjs/FlexJSStore/productsView/ProductCatalogThumbnail.mxml.  A
LayoutChangeNotifier is used to hook up the BindableCSSStyles to the
layout.

I know that seems like a lot of extra steps because it is.  It shows how
PAYG is more verbose but gives you more control.  Otherwise, all of the
MXML component tags in ProductCatalogThumbnail end up watching for change
events that never happen, and if that helps you meet your performance or
size goals, then it is probably worth it.  But the cool thing about
composition of small "beads" is that common patterns can be composited
together into a single tag so there are fewer steps, but potentially
unused or fatter code.   So someone may get tired of putting
BindableCSSStyles and LayoutChangeNotifiers in and create a
LayoutNotifyingCSSStyles widget that directly dispatches an event to the
layout, saving you a step, but at the cost of adding event listeners that
may never fire.

HTH,
-Alex

Reply via email to