{ "id": "148810", "key": "TIMOB-19030", "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": "16925", "description": "WatchKit Support--all going into 5.0 now", "name": "Release 5.0.0", "archived": true, "released": true, "releaseDate": "2015-09-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-06-25T02:26:25.000+0000", "created": "2015-06-16T02:24:06.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "httpclient", "setOnerror", "setOnload" ], "versions": [ { "id": "16711", "description": "Release 3.5.1", "name": "Release 3.5.1", "archived": false, "released": true, "releaseDate": "2015-03-06" }, { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-08-21T20:40:42.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": "h5.Reproduce Step:\r\n1.Simple run the following code in a classic mobile project.\r\n{code:title=app.js}\r\nvar url = \"http://www.appcelerator.com\";\r\nvar client = Ti.Network.createHTTPClient({\r\n timeout : 5000 // in milliseconds\r\n });\r\n \r\n client.setOnload(function(e) {\r\n \tTi.API.info(\"Received text: \" + this.responseText);\r\n alert('success');\r\n });\r\n \r\n client.setOnerror(function(e) {\r\n \tTi.API.debug(e.error);\r\n alert('error');\r\n });\r\n \r\n // Prepare the connection.\r\n client.open(\"GET\", url);\r\n // Send the request.\r\n client.send();\r\n{code}\r\n\r\nh5.Expect Result:\r\nShould fire alert event. Like its behaviour in iOS\r\n\r\nh5.Acutal Result:\r\nReturn a error, like this:\r\n{code:title=error log}\r\n[ERROR] : TiExceptionHandler: (main) [100,100] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [0,100] - In app.js:413,9\r\n[ERROR] : TiExceptionHandler: (main) [0,100] - Message: Uncaught TypeError: Object # has no method 'setOnload'\r\n[ERROR] : TiExceptionHandler: (main) [1,101] - Source: client.setOnload(function(e) {\r\n[ERROR] : V8Exception: Exception occurred at app.js:413: Uncaught TypeError: Object # has no method 'setOnload'\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: HttpClient setOnload() and setOnerror() methods do not work", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": null, "closedSprints": [ { "id": 429, "state": "closed", "name": "2015 Sprint 13 SDK", "startDate": "2015-06-23T05:39:59.141Z", "endDate": "2015-07-04T00:30:00.000Z", "completeDate": "2015-07-07T04:59:44.220Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "355906", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/6930", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-24T23:28:30.000+0000", "updated": "2015-06-24T23:28:30.000+0000" }, { "id": "360721", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\nThe setOnload() and setOnerror() methods work as expected.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.2.0.201508062204\r\nTi SDK : 5.0.0.v20150821030422\r\nTi CLI : 4.1.5\r\nAlloy : 1.7.5\r\nMAC Yosemite : 10.10.4\r\nAppc NPM : 4.2.0-1\r\nAppc CLI : 5.0.0-12\r\nNode: v0.10.37\r\nNexus 5 - Android 5.1.1\r\nNode : v0.10.37", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-08-21T20:40:37.000+0000", "updated": "2015-08-21T20:40:37.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }