You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2017/02/13 07:39:41 UTC

[jira] [Updated] (FLEX-35265) [FlexJS] can't set styles at runtime / even when using binding

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

Justin Mclean updated FLEX-35265:
---------------------------------
    Description: 
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.

  was:
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: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.


> [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
>
> 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)