aharui commented on issue #661: ColorPicker is not working
URL: https://github.com/apache/royale-asjs/issues/661#issuecomment-575034702
 
 
   Your application is set up more like:
   
   ```
   <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                   xmlns:mx="library://ns.apache.org/royale/mx"
                   xmlns:s="library://ns.apache.org/royale/spark"
                   width="600" height="400" >
       <!-- to do: layout="absolute" minWidth="955" minHeight="600" -->
       <fx:Script>
           <![CDATA[
               import mx.events.ColorPickerEvent;
               import spark.components.TextInput;
               
               [Bindable]
               private var valueObj:ValueObj = new ValueObj();
               
               public function changeEvt(event:ColorPickerEvent):void 
               {
                   purchaseRequColor.text = event.currentTarget.selectedItem;
                   valueObj.purchaseRequColor = purchaseRequColor.text;
               }
           ]]>
       </fx:Script>
       <s:Label  text="Colour" x="146" y="226.5"/>
       <s:TextInput id="purchaseRequColor" contentBackgroundColor="{(valueObj 
== null) ? 0xFFFFFF : valueObj.purchaseRequColor}" width="100" tabIndex="3" 
maxChars="30"  x="187" y="223" height="19"/>  
       <mx:ColorPicker id="purchaseColor" change="changeEvt(event);" x="296" 
y="223" height="19" width="108"/>
       
       
   </mx:Application>
   ```
   
   where ValueObj looks like:
   
   ```
   package {
       
   [Bindable]
   public class ValueObj
   {
       public var purchaseRequColor:String = "#ffeedd";
   }
   }
   ```
   
   I thought I had tested that locally, but apparently not as that scenario is 
not working.  The binding expression is not being set up correctly.  It is not 
handling the private bindable.  I will look into it tomorrow unless someone 
else can get to it sooner, but you can use the setStyle as a workaround.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to