{ "id": "91782", "key": "TIMOB-9120", "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": [], "resolution": null, "resolutiondate": null, "created": "2012-05-11T17:32:58.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:25.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Repro Step\r\nCreate a project to run the following code.\r\n\r\nExpected Result: The console out put should print out an object.\r\nActual Result: [INFO] [object Object] undefined\r\n{code}\r\n\r\nvar tabGroup = Ti.UI.createTabGroup({\r\n\tbackGroundColor:'red'\r\n});\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 1',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nwin1.add(label1);\r\n\r\n//\r\n// create controls tab and root window\r\n//\r\nvar win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 2',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nwin2.add(label2);\r\n\r\ntab2.addEventListener('focus',function(e){\r\n\tvar obj = {'tab': tab2, 'win':win2};\r\n\tTi.App.fireEvent('openTab', obj);\r\n\tTi.API.info('event is fired');\r\n});\r\n\r\n//\r\n// add tabs\r\n//\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\n\r\n\r\nTi.App.addEventListener('openTab', function(obj) {\r\n\tTi.API.info(obj +' '+obj.tab);\r\n\t\r\n});\r\n\r\n// open tab group\r\ntabGroup.open();\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "Ti.App.addEventListener does not get the object passed from Ti.App.fireEvent", "creator": { "name": "qgao", "key": "qgao", "displayName": "Qing Gao", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "qgao", "key": "qgao", "displayName": "Qing Gao", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS5.1", "comment": { "comments": [ { "id": "194623", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I'm not sure is this issue valid. According to some info, argument to \"fireEvent\" method should be JSON serializable object and Titanium objects are not for sure. I am not sure about this, because functions are not serializable, while they can be passed to \"fireEvent\" method. Can someone bring some light to this subject? Thanks.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-05-13T23:59:26.000+0000", "updated": "2012-05-13T23:59:26.000+0000" }, { "id": "244875", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces \n\nTested with\n\nTitanium Studio, build: 3.0.1.201212181159\nTitanium SDK version: 3.1.0 \nTitanium SDK version: 3.0.2 \niOS iPhone Simulator: iOS SDK version: 6.0\n", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-01T11:39:35.000+0000", "updated": "2013-04-01T11:39:35.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }