Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1038] Conditionals with negation are not working

GitHub Issuen/a
Resolution Date2014-06-05T00:42:14.000+0000
Affected Version/sAlloy 1.4.0
Fix Version/sAlloy 1.4.0
ComponentsStyling, XML
Labelsqe-3.3.0, qe-testadded, regression
ReporterFederico Casali
AssigneeTim Poulsen


Problem description

On Android, using a conditional with negation is not working on 1.4.0. Works fine using Alloy 1.3.1 so is a regression.

Steps to reproduce

The Journal sample app can be used to reproduce the issue. 1. Get the code from: https://github.com/appcelerator/alloy/tree/master/test/apps/models/journal 2. Run on Android. Add an item. Result: when adding an entry a runtime error is displayed (see screenshot). 3. Go to "views/add.xml" and change:
<Picker id="mood" platform="!ios">
<Picker id="mood" platform="android">
Run on Android and add an item Result: item is added as expected. Basically, using the conditional "!ios" is not working and the picker object was not being correctly created.


Screen Shot 2014-06-03 at 12.38.33 PM.png2014-06-03T19:39:38.000+000057814


  1. Tim Poulsen 2014-06-05

    In part, this issue was caused by the change to fix ALOY-989. However, negation only ever worked in the XML. In other words, this would have worked prior to 989: <View platform="!ios"/> However, this would not have: "#someView\[platform=!ios]" This fix submitted here enables negation in both XML and TSS, as well as supporting comma-separated lists of conditionals in both XML & TSS. PR https://github.com/appcelerator/alloy/pull/428 Functional test 1. Use the test app included with the PR. Labels in the app describe the XML platform or TSS platform conditionals used. 2. Build for each of iOS, Android, and MobileWeb. You should see the number of labels as described in the app's output. 3. Compare the labels displayed with the XML/TSS selectors used in the app's code
  2. Tim Poulsen 2014-06-05

    PR tested and merged
  3. Federico Casali 2014-06-06

    Verified fixed. Conditionals with negations works fine both when used into XML and TSS files for platform and formFactor queries. CustomTSS queries does not support conditionals with negation. TiSDK 3.3.0.v20140605150555 Alloy 1.4.0-beta2 Appcelerator Studio CLI 3.3.0-beta2 Closing.

JSON Source