{ "id": "106890", "key": "TIMOB-12147", "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": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14811", "description": "2013 Sprint 01 API", "name": "2013 Sprint 01 API", "archived": true, "released": true, "releaseDate": "2013-01-14" }, { "id": "14804", "description": "2013 Sprint 01", "name": "2013 Sprint 01", "archived": true, "released": true, "releaseDate": "2013-01-14" }, { "id": "14812", "description": "2013 Sprint 02", "name": "2013 Sprint 02", "archived": true, "released": true, "releaseDate": "2013-01-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-01-14T17:14:23.000+0000", "created": "2012-12-20T23:10:00.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "defect", "ios", "module_require", "parity", "qe-testadded", "regression", "titanbeta" ], "versions": [], "issuelinks": [ { "id": "24557", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "107942", "key": "TIMOB-12299", "fields": { "summary": "Backport TIMOB-12147 to 3.0.1", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-01-24T10:16:07.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2.Problem\r\nThere is a regression in SDK 3.0.0.GA that prevents a button's click event from firing when the button is created in a require()d unit.\r\n\r\nWorks in SDK 2.1.4.GA\r\nBroken in SDK 3.0.0.GA\r\n\r\nNote that this works fine on Android under SDK 3.0.0.GA (and SDK 2.1.4.GA)...the problem only exists on iOS.\r\n\r\nh2.Testcase\r\nRun the following code and click the button. A console message should appear when the button is clicked, and the button's title should change to \"Clicked!\", but under SDK 3.0.0.GA this does not happen.\r\n\r\nNote that this testcase is reduced down to the smallest reproducable code from a very large app.\r\n\r\n{panel:title=app.js}\r\n{code}\r\nvar win1=Ti.UI.createWindow({url:'win1.js',\r\n fullscreen:false,\r\n navBarHidden:false});\r\nwin1.ButtonMaker=require('ButtonMaker');\r\nwin1.open();\r\n{code}\r\n{panel}\r\n\r\n{panel:title=win1.js}\r\n{code}\r\nvar MainWin=Ti.UI.currentWindow;\r\n\r\nvar ButtonMaker=MainWin.ButtonMaker;\r\n\r\nfunction NewButtonClick(evt)\r\n{\r\n Ti.API.info('Button was clicked');\r\n Button1.title='Clicked!';\r\n}\r\nvar Button1=ButtonMaker.NewButton(MainWin,'Click Me',NewButtonClick);\r\n{code}\r\n{panel}\r\n\r\n{panel:title=ButtonMaker.js}\r\n{code}\r\nexports.NewButton=function(Parent,Caption,ClkEvent)\r\n{\r\n var AButton=Ti.UI.createButton({title:Caption,\r\n width:'122dp',\r\n height:'44dp'\r\n });\r\n Parent.add(AButton);\r\n AButton.addEventListener('click',ClkEvent);\r\n return AButton;\r\n};\r\n{code}\r\n{panel}\r\n", "attachment": [], "flagged": false, "summary": "iOS: regression: button created in require()d unit won't fire click event", "creator": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "environment": "-iOS 6.0 (simulator)\r\n-Mac OSX 10.7.2\r\n-Titanium Mobile SDK 3.0.0.GA\r\n-Titanium Studio 3.0.1.201212181159", "comment": { "comments": [ { "id": "232268", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Shawn,\r\ndid you notice the following warning?\r\n{code}\r\n[WARN] Creating [object TiUIButton] in a different context than the calling function.\r\n{code}\r\n\r\nChange win1.js code to require module from there, and it will work.\r\n{code}\r\nvar MainWin=Ti.UI.currentWindow;\r\n\r\nvar ButtonMaker=require('ButtonMaker');\r\n\r\nfunction NewButtonClick(evt)\r\n{\r\n Ti.API.info('Button was clicked');\r\n Button1.title='Clicked!';\r\n}\r\nvar Button1=ButtonMaker.NewButton(MainWin,'Click Me',NewButtonClick);\r\n{code}", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-20T23:25:14.000+0000", "updated": "2012-12-20T23:27:42.000+0000" }, { "id": "232415", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Max, yes I noticed that warning. In the past (pre 3.0 SDK) we've received that warning with no detrimental effect.\n\nWe've been using require() like in my example for a year and a half now with many apps dedicated to our CommonJS framework. Moving all of our require() statements into every unit is not a practical solution for us. There are dozens of them with complex relationships (units that require units that require units). The example I gave is a significantly reduced bit of code to make it easy to see the problem.\n\nMy code works fine in Android. It works fine in SDK 2.1.4. Something in 3.0.0 caused a regression. Please see if this can be addressed. Thanks.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-12-21T14:30:56.000+0000", "updated": "2012-12-21T14:30:56.000+0000" }, { "id": "232482", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Shawn--we'll be fixing this the next sprint, which should hopefully be in time for your application deployment (though you will need an unofficial build).", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-22T00:45:19.000+0000", "updated": "2012-12-22T00:45:19.000+0000" }, { "id": "232861", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Thanks, Ingo...looking forward to it.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-02T14:14:25.000+0000", "updated": "2013-01-02T14:14:25.000+0000" }, { "id": "233433", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending https://github.com/appcelerator/titanium_mobile/pull/3668", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-07T13:03:22.000+0000", "updated": "2013-01-07T13:03:22.000+0000" }, { "id": "234281", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull merged.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-14T17:14:23.000+0000", "updated": "2013-01-14T17:14:23.000+0000" }, { "id": "234560", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Any chance of this being merged into the 3.0.1 SDK?", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-16T07:28:14.000+0000", "updated": "2013-01-16T07:28:14.000+0000" }, { "id": "234568", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Vishal--I added a backport request. Can we see if this can be addressed?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-16T08:57:36.000+0000", "updated": "2013-01-16T08:57:36.000+0000" }, { "id": "234589", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "backport PR https://github.com/appcelerator/titanium_mobile/pull/3718\nRelated JIRA ticket is TIMOB-12299", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-16T10:18:05.000+0000", "updated": "2013-01-16T10:18:05.000+0000" }, { "id": "234886", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Now the button is changed to 'Clicked' and console message also appears.\r\nEnvironment used for verification -\r\n-iOS 6.0 (simulator)\r\n-Mac OSX 10.8\r\n-Titanium Mobile SDK 3.1.0.v20130114171802\r\n-Titanium Studio 3.0.1.201212181159", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-18T02:18:29.000+0000", "updated": "2013-01-18T02:18:29.000+0000" }, { "id": "234909", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Verified fixed in SDK 3.1.0.v20130114171802. Thanks!", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-18T07:07:18.000+0000", "updated": "2013-01-18T07:07:18.000+0000" }, { "id": "235576", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Also verified fixed in SDK 3.0.2.v20130122172624.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-23T21:07:14.000+0000", "updated": "2013-01-23T21:07:14.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }