Titanium JIRA Archive
Alloy (ALOY)

[ALOY-729] Alloy fails to compile when TabbedBar Labels have no properties

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-08-01T15:10:53.000+0000
Affected Version/sAlloy 1.0.0
Fix Version/sAlloy 1.3.0
ComponentsXML
Labelsn/a
ReporterDaniel Sefton
AssigneeTony Lukasavage
Created2013-06-27T09:23:16.000+0000
Updated2013-10-14T18:30:30.000+0000

Description

Problem

The TabbedBar component is well documented at http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.iOS.TabbedBar In the example of the documentation, the Labels texts are included directly in the XML template, which is not a convenient solution (at the moment) for the developer who works on a i18n application, who will probably prefer to set the Label's text properties in the associated tss file. This makes alloy bug in its compilation process.

Test case

index.xml

Doing so makes alloy fail to compile (the compilation stops):
<Alloy>
    <Window class="container" id="container">
        <TabbedBar id="bb1" platform="ios">
            <Labels>
                <Label id="options1" />
                <Label id="options2" />
            </Labels>
        </TabbedBar>
    </Window>
</Alloy>
The error is:
Alloy/commands/compile/parsers/Alloy.Abstract.BarItemType.js:30
		logger.warn('<BarItemType> at index ' + index + ' has no properties');
		                                        ^
ReferenceError: index is not defined
    at parse (Alloy/commands/compile/parsers/Alloy.Abstract.BarItemType.js:30:43)
    at Object.exports.parse (Alloy/commands/compile/parsers/base.js:11:17)
    ...
    ...
After digging in the code, I guess that the same should occur with Alloy.Abstract.CoverFlowImageType.js

Comments

  1. Daniel Sefton 2013-06-27

    Tested and confirmed when building for iOS 6 simulator with Ti SDK 3.1.1 GA and Alloy 1.1.3.
  2. Tony Lukasavage 2013-08-01

    PR: https://github.com/appcelerator/alloy/pull/206 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/ui/tabbedbar This was resolved by an earlier commit. The PR contains an update to the test app that includes the ticket description's test case. Functional testing passes if the app compiles and runs successfully for iOS.
  3. Federico Casali 2013-10-14

    Verified as fixed. TiSDK 3.2.0.v20131013140318 Alloy 1.3.0 iOS 7 (Xcode 5) Closing.

JSON Source