Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-1056

Cannot set onTintColor attribute/property in XML markup

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Alloy 1.4.0
    • Fix Version/s: Alloy 1.5.0
    • Component/s: XML
    • Environment:

      Mac OS X 10.8.5
      Titanium SDK: 3.3.0.v20140619130123
      Alloy 1.5.0-dev/commit 969bfaedf5fbb7f587c58be329b9db5159098979/Mon Jun 16 20:07:02 2014 -0400
      Xcode 5.0.2/iOS 7.0.3/iOS Simulator 3.5" Retina

    • Sprint:
      2014 Sprint 12 Alloy

      Description

      Preface
      Not sure if this is an Alloy bug or we should not prefix property names with "on" in the Titanium SDK.

      Description
      Titanium SDK 3.3.0 introduces a new property for iOS that changes the color of the button when it is switched on: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Switch-property-onTintColor

      When using this property in Alloy XML markup, Alloy thinks it's an event.

      Property works fine in TSS or Controller code.

      REPRODUCTION and RESULTS
      The code below fails in the simulator with this error:

      [ERROR] :  Script Error {
      [ERROR] :      backtrace = "#0 () at file:///Users/bhatfield/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/4D9D3D70-9C78-4444-8A90-3C0277E07381/TestNewApis.app/alloy.js:232";
      [ERROR] :      line = 34;
      [ERROR] :      message = "Can't find variable: green";
      [ERROR] :      name = ReferenceError;
      [ERROR] :      sourceId = 268417408;
      [ERROR] :      sourceURL = "file:///Users/bhatfield/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/4D9D3D70-9C78-4444-8A90-3C0277E07381/TestNewApis.app/alloy/controllers/index.js";
      [ERROR] :  }
      

      Test Case:

      <Alloy>
      	<Window class="container">
      		<Switch tintColor="red" onTintColor="green" thumbTintColor="blue"/>
      	</Window>
      </Alloy>
      

        Attachments

          Activity

            People

            • Assignee:
              fmiao Feon Sua Xin Miao
              Reporter:
              bhatfield Benjamin Hatfield (Inactive)
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration