{ "id": "170811", "key": "TIMOB-25687", "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": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-02-19T11:30:54.000+0000", "created": "2018-01-17T13:15:52.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Android", "picker" ], "versions": [], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2018-03-02T00:38:11.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": "The first time a Picker changes, the change event is not fired. The subsequent times everything is fine.\r\n\r\n*Test code:*\r\n\r\n+View:+\r\n{code:xml}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n+Controller:+\r\n{code:javascript}\r\nfunction open(){\r\n\t\r\n}\r\n\r\nvar halfDay = [];\r\nhalfDay[0]=Ti.UI.createPickerRow({title:L('halfDay')});\r\nhalfDay[1]=Ti.UI.createPickerRow({title:L('fullDay')});\r\n\r\nvar type = [];\r\nloadTypes();\r\n\r\nfunction loadTypes() {\r\n\tvar url = \"https://www.google.es\";\r\n\tvar xhr = Ti.Network.createHTTPClient({\r\n\t\tonload : function(e) {\r\n\t\t\t// var json = JSON.parse(decodeURIComponent(this.responseText));\r\n\t\t\t\r\n\t\t\t// var datas = json.datas;\r\n\t\t\t\r\n\t\t\tvar datas = {\r\n\t\t \"vac_tipos\": [\r\n\t\t {\r\n\t\t \"tipo\": \"F\",\r\n\t\t \"nombre\": \"Festivos\"\r\n\t\t },\r\n\t\t {\r\n\t\t \"tipo\": \"V\",\r\n\t\t \"nombre\": \"Vacaciones\"\r\n\t\t },\r\n\t\t {\r\n\t\t \"tipo\": \"U\",\r\n\t\t \"nombre\": \"Puente\"\r\n\t\t },\r\n\t\t {\r\n\t\t \"tipo\": \"FF\",\r\n\t\t \"nombre\": \"Festivo Especial\"\r\n\t\t },\r\n\t\t {\r\n\t\t \"tipo\": \"NI\",\r\n\t\t \"nombre\": \"DIAS Navidad\"\r\n\t\t }\r\n\t\t ]\r\n\t\t\t \r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor (var i = 0; i < datas.vac_tipos.length; i++) \r\n\t\t\t{\r\n\t\t\t\ttype[i] = Ti.UI.createPickerRow({title: datas.vac_tipos[i].nombre});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (OS_ANDROID) \r\n\t\t\t{\r\n\t\t\t\t$.pickerType.add(type);\r\n\t\t\t\t$.pickerType.selectionIndicator = true;\r\n\t\t\t\t\r\n\t\t\t\t$.pickerHalfDay.add(halfDay);\r\n\t\t\t\t$.pickerHalfDay.selectionIndicator = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tonerror : function(e) {\r\n\t\t\tTi.API.debug(e.error);\r\n\t\t},\r\n\t\ttimeout : 5000\t\t\r\n\t});\r\n\txhr.open(\"GET\", url);\r\n\txhr.send();\r\n}\r\n\r\nfunction pickerChange(){\r\n\tTi.API.info('Change listener triggered');\r\n}\r\n{code}\r\n+Style:+\r\n{code:css}\r\n\"Window[platform=android]\" : {\r\n\twindowSoftInputMode: Ti.UI.Android.SOFT_INPUT_STATE_HIDDEN\r\n}\r\n\r\n\".container\": { \r\n\tbackgroundColor:\"#DCDCDC\",\r\n}\r\n\r\n\"#scrollView\": {\r\n\tlayout: 'vertical'\r\n}\r\n\"#infoView\" : {\r\n\tlayout: 'vertical',\r\n\theight: Ti.UI.SIZE\r\n}\r\n\r\n\".labels\" : {\r\n\tleft: \"10dp\"\r\n}\r\n\r\n\"Picker[platform=android]\" : {\r\n\twidth: \"35%\",\r\n\tborderColor: 'black',\r\n\tborderWidth: '1',\r\n\tright: \"10dp\"\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Picker change listener doesn't work the first time", "creator": { "name": "gfigueras", "key": "gfigueras", "displayName": "Guillermo Figueras", "active": true, "timeZone": "Europe/Madrid" }, "subtasks": [], "reporter": { "name": "gfigueras", "key": "gfigueras", "displayName": "Guillermo Figueras", "active": true, "timeZone": "Europe/Madrid" }, "environment": "Titanium SDK 7.0.1.GA\r\nTested on Google Nexus 5X, Android 7.1.0 (Emulator)", "closedSprints": [ { "id": 1000, "state": "closed", "name": "2018 Sprint 04 SDK", "startDate": "2018-02-12T04:23:01.913Z", "endDate": "2018-02-26T04:23:00.000Z", "completeDate": "2018-02-26T19:36:01.769Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "433290", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I have tested the issue with the same Android version emulator, I wasn't able to reproduce the issue. The change event does fire every time I change the value of picker. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-01-18T04:32:17.000+0000", "updated": "2018-01-18T04:32:17.000+0000" }, { "id": "433298", "author": { "name": "gfigueras", "key": "gfigueras", "displayName": "Guillermo Figueras", "active": true, "timeZone": "Europe/Madrid" }, "body": "@Sharif, I updated the test code. I think the problem has to do with httpclient requests.", "updateAuthor": { "name": "gfigueras", "key": "gfigueras", "displayName": "Guillermo Figueras", "active": true, "timeZone": "Europe/Madrid" }, "created": "2018-01-18T09:32:38.000+0000", "updated": "2018-01-18T09:32:38.000+0000" }, { "id": "433429", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~gfigueras], The issue seems to be reproducible with the updated sample code, The picker change event does not fire on first picker change. On the subsequent change, it does. Moving to TIMOB.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-01-21T06:36:40.000+0000", "updated": "2018-01-21T06:36:40.000+0000" }, { "id": "433521", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9763", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-01-23T15:36:30.000+0000", "updated": "2018-01-23T15:36:30.000+0000" }, { "id": "434447", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\n\r\nWaiting for merge to be enabled.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-14T00:06:43.000+0000", "updated": "2018-02-14T00:06:43.000+0000" }, { "id": "435085", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.1.0.v20180301114750 & 7.2.0.v20180301081409.\r\n\r\nClosing.\r\n\r\nStudio Ver: 5.0.0.201712081732\r\nOS Ver: 10.13.2\r\nXcode Ver: Xcode 9.2\r\nAppc NPM: 4.2.12\r\nAppc CLI: 7.0.2\r\nDaemon Ver: 1.0.1\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.11.0\r\nNode Ver: 8.9.1\r\nNPM Ver: 5.5.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ google Nexus 6P — Android 8.0.0\r\n⇨ google Nexus 5 — Android 6.0.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-02T00:38:00.000+0000", "updated": "2018-03-02T00:38:00.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }