{ "id": "83255", "key": "TIMOB-6393", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" }, { "id": "12094", "description": "", "name": "Sprint 2012-02", "archived": true, "released": true, "releaseDate": "2012-01-29" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-18T16:17:46.000+0000", "created": "2011-11-30T15:05:14.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "branch-v8", "module_window", "parity", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-03-04T22:12:16.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Run the code below. \r\nClick the anywhere in the window except the bottom label, the bottom label shows \"window: You clicked on undefined\".\r\nExpected behavior: The bottom label shows \"window: You clicked on window\".\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow(); \r\n\r\nwin.backgroundColor = '#13386c';\r\nwin.name = \"window\";\r\n\r\nvar l2 = Ti.UI.createLabel({\r\n\tcolor:'white',\r\n\tfont:{fontSize:14,fontWeight:'bold',fontFamily:'Helvetica Neue'},\r\n\tbottom:5,\r\n\ttextAlign:'center',\r\n\ttext:'click anywhere',\r\n\theight:'auto',\r\n\twidth:'auto'\r\n});\r\n\r\n\r\nwin.add(l2);\r\n\r\nfunction clear(o)\r\n{\r\n\tvar t = o.text;\r\n\tsetTimeout(function()\r\n\t{\r\n\t\tif (o.text == t)\r\n\t\t{\r\n\t\t\to.text = \"\";\r\n\t\t}\r\n\t},1000);\r\n}\r\n\r\nwin.addEventListener('click',function(ev)\r\n{\r\n\tl2.text = \"window: You clicked on \" +ev.source.name;\r\n\tclear(l2);\r\n});\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Lightweight Window, Source of Events is undefined", "creator": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Studio: 1.0.7.201111291553\r\nRuntime: 1.8.0.1\r\nMacOSX: 10.6.8", "comment": { "comments": [ { "id": "176948", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.1.v20111220190134 on \r\nLG Slate (3.1) v8/rhino", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-21T15:42:31.000+0000", "updated": "2011-12-21T15:42:31.000+0000" }, { "id": "177979", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Still encountering the issue. If you click in the label area when the label is not invoked you will see \"You clicked on a window\", but if you click the label area when it is invoked, you get \"You click on undefined\"\r\n\r\nTested with 1.8.0.1", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-04T10:39:40.000+0000", "updated": "2012-01-04T10:39:40.000+0000" }, { "id": "179582", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "When we click the label area, the source of events is the label. Since we don't specify the name of the the label in the code, it will show \"You click on undefined\". Therefore, it's an expected behavior.\r\nIn order to avoid such confusion, write another test sample below.\r\n{code}\r\nvar win = Ti.UI.createWindow(); \r\n\r\nwin.backgroundColor = '#13386c';\r\nwin.name = \"window\";\r\n\r\nwin.addEventListener('click',function(ev)\r\n{\r\n\tTi.API.info(\"window: You clicked on \" +ev.source.name);\r\n});\r\n\r\nwin.open();\r\n{code}\r\nClick anywhere in the window and check the log. The expected behavior: \"window: You clicked on window\" shows in the log.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-17T10:38:31.000+0000", "updated": "2012-01-17T10:38:31.000+0000" }, { "id": "179801", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.9.0.v20120118110134", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-18T16:17:46.000+0000", "updated": "2012-01-18T16:17:46.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }