You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Piotr Zarzycki (JIRA)" <ji...@apache.org> on 2017/03/18 20:03:42 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=15931360#comment-15931360 ]
Piotr Zarzycki commented on FLEX-35265:
---------------------------------------
Hi [~jmclean],
Did you have a chance to try last Peter's changes ? For me following code is working fine in JS sight:
{code}
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/basic">
<fx:Script><![CDATA[
import org.apache.flex.events.MouseEvent;
public function onTextButtonClick(event:MouseEvent):void
{
box.style.backgroundColor = "#FFF000";
}
]]></fx:Script>
<js:valuesImpl>
<js:SimpleCSSValuesImpl/>
</js:valuesImpl>
<js:initialView>
<js:View>
<js:Container id="box" width="100" height="100">
<js:style>
<js:BindableCSSStyles backgroundColor="blue" />
</js:style>
<js:beads>
<js:StyleChangeNotifier />
</js:beads>
</js:Container>
<js:TextButton text="Click me" click="onTextButtonClick(event)" />
</js:View>
</js:initialView>
</js:Application>
{code}
Thanks,
Piotr
> [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)