Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1307] Boolean value set in Alloy mark-up is being parsed to string as either "false" or "true" in controller

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-07-07T04:23:40.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
Labelscore, defect
ReporterDavid He
AssigneeMauro Parra-Miranda
Created2014-07-05T07:42:47.000+0000
Updated2016-03-08T07:37:42.000+0000

Description

Expected Result

No alert message is seen

Actual Result

Alert is triggered
<Alloy>
     <Window> 
     <TextField editable="false" id="tf1" />  
   </Window
</Alloy>
   if($.tf1.editable) {
          alert("it is editable!!"); //invoked as editable is being evaluated as //string "false"
    }

Comments

  1. Mostafizur Rahman 2014-07-07

    Hello, We tested this issue with our modified sample code bellow. We can’t reproduce this issue. It’s working as expected with Titanium SDK 3.3.0 RC. In TextField object, editable property value should be Boolean type but given by string. If we change string type to Boolean then its working perfect.
        <Alloy>
       <Window>
       <TextField editable="false" id="tf1" />
       </Window>
       </Alloy>
       
    to
       
        <Alloy>
       <Window>
       <TextField editable=false id="tf1" />
       </Window>
       </Alloy>
       
    Thanks
  2. Mauro Parra-Miranda 2014-07-07

    Please use editable=false
  3. David He 2014-07-07

    Surprisingly, Alloy mark-up can have attribute values without being quoted!!!!! See XML definition from [W3C](http://www.w3schools.com/xml/xml_syntax.asp)

JSON Source