flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piotr Zarzycki (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (FLEX-35265) [FlexJS] can't set styles at runtime / even when using binding
Date Mon, 13 Feb 2017 20:40:41 GMT

     [ https://issues.apache.org/jira/browse/FLEX-35265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Piotr Zarzycki reassigned FLEX-35265:
-------------------------------------

    Assignee: Piotr Zarzycki

> [FlexJS] can't set styles at runtime / even when using binding
> --------------------------------------------------------------
>
>                 Key: FLEX-35265
>                 URL: https://issues.apache.org/jira/browse/FLEX-35265
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: FlexJS
>    Affects Versions: Apache FlexJS 0.8.0
>            Reporter: Justin Mclean
>            Assignee: Piotr Zarzycki
>
> This code fails to work as expected (box stays black), but it's a feature not a bug.
> {code}
> <?xml version="1.0" encoding="utf-8"?>
> <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                xmlns:js="library://ns.apache.org/flexjs/basic"
>                xmlns:comp="comp.*">
>    <fx:Script><![CDATA[
>        public function clicked():void {
>            box.style = "background-color:red";
>        }
>        ]]></fx:Script>
>    <js:valuesImpl>
>        <js:SimpleCSSValuesImpl/>
>    </js:valuesImpl>
>    <js:initialView>
>        <js:View>
>            <js:VContainer>
>                <js:Container id="box" width="100" height="100" style="background-color:black"
/>
>                <js:TextButton text="Click me" click="clicked()" />
>            </js:VContainer>
>        </js:View>
>    </js:initialView>
> </js:Application>
> {code}
> This code which I think should work, fails to display a black or red box:
> {code}
> <?xml version="1.0" encoding="utf-8"?>
> <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>               xmlns:js="library://ns.apache.org/flexjs/basic">
>    <js:beads>
>       <js:ContainerDataBinding />
>        <js:BindableCSSStyles />
>    </js:beads>
>   <fx:Script><![CDATA[
>       [Bindable] public var boxStyle:String = "background-color:black";
>       public function clicked():void {
>           boxStyle = "background-color:red";
>       }
>       ]]></fx:Script>
>   <js:valuesImpl>
>       <js:SimpleCSSValuesImpl/>
>   </js:valuesImpl>
>   <js:initialView>
>       <js:View>
>           <js:VContainer>
>               <js:Container id="box" width="100" height="100" style="{boxStyle}" />
>               <js:TextButton text="Click me" click="clicked()" />
>           </js:VContainer>
>       </js:View>
>   </js:initialView>
> </js:Application>
> {code}
> Of course I could be using BindableCSSStyles wrong.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message