{ "id": "170225", "key": "TIMOB-25482", "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": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-10-17T16:16:21.000+0000", "created": "2017-11-05T17:02:17.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "Navistar" ], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-10-17T16:16:21.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": "Hello,\r\n\r\nSearchBar \"No Results\" in ListView is not showing on ItemTemplate label in 6.2.2.GA and later but it works on lower SDKs.\r\n\r\n*Test Environment:*\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 6.10.3\r\n npm Version = 3.10.10\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 6.3.0.GA, 6.2.2.GA, 6.1.1.GA\r\n\r\n*Test Code:*\r\nAdded the test code *index.xml*, *index.js* and *index.tss* file on the attachment\r\n\r\n*Output Results:*\r\nSearchBar \"No Results\" in ListView is not showing on ItemTemplate label in 6.2.2.GA and later but showing on 6.1.1.GA(see the attachment image).\r\n\r\n*Expected Results:*\r\nSearchBar \"No Results\" in ListView shows on ItemTemplate label.", "attachment": [ { "id": "63532", "filename": "6.1.1.GA.png", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-05T16:54:49.000+0000", "size": 54379, "mimeType": "image/png" }, { "id": "63533", "filename": "index.js", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-05T16:48:27.000+0000", "size": 1659, "mimeType": "text/javascript" }, { "id": "63534", "filename": "index.tss", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-05T16:48:12.000+0000", "size": 792, "mimeType": "application/octet-stream" }, { "id": "63535", "filename": "index.xml", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-05T16:47:49.000+0000", "size": 709, "mimeType": "text/xml" } ], "flagged": false, "summary": "iOS: SearchBar \"No Results\" in ListView is not showing on ItemTemplate label in 6.2.2.GA and later", "creator": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "TiSDK: 6.2.2.GA, 6.3.0.GA, iOS", "closedSprints": [ { "id": 990, "state": "closed", "name": "2018 Sprint 02 SDK", "startDate": "2018-01-14T22:48:43.544Z", "endDate": "2018-01-28T22:48:00.000Z", "completeDate": "2018-01-29T16:22:42.911Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "430145", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Before 6.2.0, for search in iOS there was getting used UISearchDisplayController. If there is nothing found while searching, UISearchDisplayController manages to show “No Results” natively. There was nothing added from titanium side for this. \r\nIn 6.2.0, we have replaced UISearchDisplayController with UISearchController as UISearchDisplayController got deprecated in iOS 8.0 . UISearchController do not show anything similar to “No Results” if there is nothing found while searching. Due to this “No Results” is shown in 6.2.0 and above. So this is native behavior of iOS.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-06T07:33:23.000+0000", "updated": "2017-11-06T07:36:06.000+0000" }, { "id": "430148", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I agree with [~vijaysingh], this has been a change by Apple to allow more flexible empty-states. If desired, we can provide a code-snippet that recreates the \"No results\" label via a simple list-template. Let us know!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-06T07:39:38.000+0000", "updated": "2017-11-06T07:39:38.000+0000" }, { "id": "430814", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I just tried it out and it seems to be a valid issue: While it is the expected behavior to not show the \"No results\" automatically because of the newer Apple API's, I am unable to display an own placeholder either, because the search-controller is presented over the current view-controller index. We should fix this inside the search-implementations instead.\r\n\r\nRead more [here|https://stackoverflow.com/a/4840621/5537752].", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-16T11:58:46.000+0000", "updated": "2017-11-16T12:00:26.000+0000" }, { "id": "433301", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~vijaysingh] I think your recent changes fix this as well. Can you confirm?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-18T12:57:40.000+0000", "updated": "2018-01-18T12:57:40.000+0000" }, { "id": "433326", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel] This is native behavior, if we use UISearchController. But from 7.0.2 onward, we can give workaround to add our own placeholder because we are using same tableview to show result. ", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-19T03:40:40.000+0000", "updated": "2018-01-19T03:40:40.000+0000" }, { "id": "437095", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test Case -\r\n\r\n{code:java}\r\nvar rows = [];\r\nfor (var i = 0; i < 20; i++) {\r\n rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}});\r\n}\r\nvar win = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: '#ffffff',\r\n}); \r\nvar sb = Ti.UI.createSearchBar();\r\n \r\nvar ls = Ti.UI.createListSection({\r\n items: rows\r\n});\r\n \r\n var lv = Ti.UI.createListView({\r\n //top : 100,\r\n sections: [ls],\r\n searchView: sb,\r\n});\r\n \r\nsb.setHintText(\"test\");\r\n sb.addEventListener('change', function(e){\r\n Ti.API.info(e.value);\r\n});\r\n \r\n //when the return key is hit, remove focus from our searchBar\r\nsb.addEventListener('return', function(e){\r\n sb.blur();\r\n});\r\nlv.addEventListener('itemclick', function(e) {\r\n Ti.API.info('click at index: ' + e.itemIndex);\r\n});\r\n\r\nlv.addEventListener('noresults', function(e) {\r\n\tTi.API.info('no result found');\r\n});\r\n \r\nwin.add(lv);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-24T07:59:45.000+0000", "updated": "2018-04-24T07:59:45.000+0000" }, { "id": "437101", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "From SDK 7.0.2 onwards following workaround can help -\r\n\r\n\r\n{code:java}\r\nvar rows = [];\r\nfor (var i = 0; i < 20; i++) {\r\n rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}});\r\n}\r\nvar win = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: '#ffffff',\r\n}); \r\n\r\n//Create label with no text\r\nvar label = Ti.UI.createLabel({\r\n\ttext: '',\r\n\tcolor: 'lightgray',\r\n\tfont: {\r\n\t\tfontWeight: 'bold',\r\n\t\tfontSize: 22\r\n\t},\r\n\tbackgroundColor: 'transparent'\r\n});\r\n\r\nvar sb = Ti.UI.createSearchBar();\r\n \r\nvar ls = Ti.UI.createListSection({\r\n items: rows\r\n});\r\n \r\n var lv = Ti.UI.createListView({\r\n sections: [ls],\r\n searchView: sb,\r\n});\r\n \r\nsb.setHintText(\"test\");\r\n sb.addEventListener('change', function(e){\r\n label.text = '';\r\n});\r\n \r\n //when the return key is hit, remove focus from our searchBar\r\nsb.addEventListener('return', function(e){\r\n sb.blur();\r\n});\r\n\r\nsb.addEventListener('cancel', function(e){\r\n sb.blur();\r\n label.text = '';\r\n});\r\n\r\nlv.addEventListener('itemclick', function(e) {\r\n Ti.API.info('click at index: ' + e.itemIndex);\r\n});\r\n \r\nlv.addEventListener('noresults', function(e) {\r\n\t// Set text 'No Results' to label\r\n\tlabel.text = 'No Results';\r\n});\r\n\r\n//Add label on listview\r\nlv.add(label);\r\n\r\nwin.add(lv);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-24T11:20:35.000+0000", "updated": "2018-04-24T11:20:35.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }