Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1516] Alloy: Text property inside LABEL element not displaying output of any method in combination with any text correctly

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-09-06T03:39:52.000+0000
Affected Version/sRelease 5.4.0, Release 5.3.1
Fix Version/salloy 1.9.2, Release 5.5.0
ComponentsTitanium SDK
Labelslabel, labels
ReporterNeeraj Mishra
AssigneeFeon Sua Xin Miao
Created2016-08-30T22:32:42.000+0000
Updated2016-09-15T14:17:37.000+0000

Description

Problem Description:

Text Property inside UI Element Label is not displaying output of a method used in combination with a text in an expected manner.

Sample Code:

Alloy index.xml file content:
<Alloy>
	<Window>
		<View>
			<Label textAlign="centerAlign" text="'Version:' + Ti.App.getVersion()"></Label>
		</View>
	</Window>
</Alloy>
Alloy index.js file inside controller:
$.index.open();

Output: 'Version:' + Ti.App.getVersion()

Expected Output: Version:1.0

Scenario 1:

Output is: 'Version:' + Ti.App.getVersion()

Scenario2:

Output is : 1.0Version This output the value as expected but if we prefix some text before the method, it consider the whole as a text and displays it inside label rather executing the method. I have tried with some other methods like Ti.getVersion() and it is the same behavior. Please let us know if any other info is required.

Comments

  1. Neeraj Mishra 2016-08-30

    INC0397519
  2. Feon Sua Xin Miao 2016-09-01

    PR: https://github.com/appcelerator/alloy/pull/796
  3. Kondal Kolipaka 2016-09-06

    Merged into master branch.
  4. Ewan Harris 2016-09-15

    Verified using: Windows 10 Pro, OSX 10.11.6 Appc Core: 5.5.0 Appc NPM: 4.2.7 Ti SDK: 5.5.0.GA Galaxy Note 3 (Android 5.0) Lumia 930 (Windows 10 Mobile) iPhone 7 Plus simulator (iOS 10.0) The label now displays the expected output of Version:1.0 Closing ticket

JSON Source