justinmclean opened a new issue #35: Values on radio buttons are not being set
URL: https://github.com/apache/royale-asjs/issues/35
 
 
   In this code the selected value label is always set to be be an empty sting:
   ```
   <?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">
   
   
       <fx:Script><![CDATA[
           public function showSelected():void {
               selected.text = radio.selected.toString();
               selectedValue.text = radio.selectedValue.toString();
           }
           ]]></fx:Script>
   
       <js:valuesImpl>
           <js:SimpleCSSValuesImpl/>
       </js:valuesImpl>
   
       <js:initialView>
           <js:View>
               <js:Group id="content">
                   <js:beads>
                       <js:VerticalLayout />
                   </js:beads>
                   <js:RadioButton id="radio" text="one" value="1" 
groupName="group" click="showSelected()"/>
                   <js:RadioButton text="two" value="2" groupName="group" 
click="showSelected()"/>
                   <js:RadioButton text="three" value="3" groupName="group" 
click="showSelected()"/>
                   <js:Label id="selected" />
                   <js:Label id="selectedValue" />
               </js:Group>
           </js:View>
       </js:initialView>
   
   </js:Application>
   
   ```
   
![2017-10-16_10-25-45](https://user-images.githubusercontent.com/144504/31590465-6c2952ca-b25c-11e7-8f9b-5947d0a87807.png)
   
   
   The issue looks to be in the generated JS and/or the Language.as method:
   ```
   org.apache.flex.html.RadioButton.prototype.set__value = function(v) {
     org.apache.flex.utils.Language.as(this.icon.element, 
HTMLInputElement).value = org.apache.flex.utils.Language.as(v, String);
   };
   ```
   From the code:
   ```
                public function set value(newValue:Object):void
                {
                        IValueToggleButtonModel(model).value = newValue;
                }
   ```
   
   As it thinks newValue  / v is a number and not a string and the expression 
"number as String" will always return null.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to