Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23487] Windows: e.source.apiName inconsistancy with iOS & Android

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelswindows
ReporterDee Clawson
AssigneeChristopher Williams
Created2016-06-01T00:47:20.000+0000
Updated2016-06-10T01:09:35.000+0000

Description

Problem

All the methods from alloy (onClick, onBlur, onReturn, etc.) are returning a different e.source.apiName on Windows 8.1 & 10 then iOS & Android. Windows is returning Titanium.UI., while iOS & Android return Ti.Ui.

Expected

Windows perform the same as iOS & Android.

Sample Code

function doClick(e) {
    alert(e.source.apiName);
}

$.index.open();
<Alloy>
	<Window class="container">
		<Label id="label" onClick="doClick">Hello, World</Label>
	</Window>
</Alloy>
".container": {
	backgroundColor:"white"
}

"Label": {
	width: Ti.UI.SIZE,
	height: Ti.UI.SIZE,
	color: "#000"
}

"#label": {
	font: {
		fontSize: 12
	}
}

Comments

  1. Nazmus Salahin 2016-06-02

    Hello, Thanks for creating this ticket. It will be appreciated if you provide test code and step to reproduce this issue. Once we are able to reproduce the issue we will escalate the ticket. Thanks in advance
  2. Dee Clawson 2016-06-02

    @nsalahin Code inserted into description.
  3. Sharif AbuDarda 2016-06-02

    FYI, "Titanium.UI." and "Ti.UI." are same thing.
  4. Dee Clawson 2016-06-02

    @sdarda "Titanium.UI.Label" !== "Ti.UI.Label" The namespace may be the same. Yaw'll are outputting it as text though.
  5. Dee Clawson 2016-06-02

    @sdarda FYI. You (Appcelerator) provide an event method, the emitter on that event method outputs JSON. Somewhere in that JSON you have a key of "source". Under that key is another key "apiName". The bug I have pointed out addresses this key value pair. It is different in ios/android from windows. In ios/android you (Appcelerator) use the string "Ti", in windows you (Appcelerator) use the string "Titanium".
  6. Nazmus Salahin 2016-06-05

    Hello, I am able to reproduce this issue with given code and given steps. *Steps:* 1. Create a default alloy project with given code for Windows and Android phone. 2. Build and run the app on windows phone and click the label. e.source.apiName is returned in the alert as Titanium.UI.Label [Screenshot](https://i.imgsafe.org/3bd986b073.png) 3. Build and run the app on android phone and click the label. e.source.apiName is returned in the alert as Ti.UI.Label [Screenshot](https://i.imgsafe.org/3be0287909.png) Thanks *Environment*: *Device info:* HTC One(android 4.4.3), Windows Phone Emulator (Windows 8.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.4.0.v20160509133737 *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0

JSON Source