{ "id": "171490", "key": "TIMOB-25952", "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": "10000", "description": "", "name": "Done" }, "resolutiondate": "2018-04-16T09:18:54.000+0000", "created": "2018-04-10T14:00:34.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:34:50.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\nWe have an issue with Listview setHeaderView with search. HeaderView is not displayed on iOS with search bar but its working on android. \r\n\r\nTest code:\r\n{code}\r\nvar popularSearchList = [],\r\n searchList = [],\r\n popularSearchListData = [],\r\n searchListData = [];\r\nfor (var i = 0; i < 5; i++) {\r\n\tpopularSearchList.push({\r\n\t\tid : i,\r\n\t\tname : \"Bhuvan \" + i\r\n\t});\r\n}\r\nsearchList.push({\r\n\tid : 0,\r\n\tname : \"ListView\"\r\n}, {\r\n\tid : 1,\r\n\tname : \"TextField\"\r\n}, {\r\n\tid : 2,\r\n\tname : \"EditText\"\r\n}, {\r\n\tid : 3,\r\n\tname : \"Spinner\"\r\n}, {\r\n\tid : 4,\r\n\tname : \"Button\"\r\n}, {\r\n\tid : 5,\r\n\tname : \"ImageView\"\r\n}, {\r\n\tid : 6,\r\n\tname : \"ImageButton\"\r\n}, {\r\n\tid : 7,\r\n\tname : \"RecyclerView\"\r\n}, {\r\n\tid : 8,\r\n\tname : \"CardView\"\r\n});\r\n\r\nshowRecentSearchList(popularSearchList);\r\nshowSearchList(searchList);\r\n\r\nfunction showRecentSearchList(popularSearchList) {\r\n\t_.each(popularSearchList, function(popularSearchDataObj) {\r\n\t\tvar listRowObj = {\r\n\t\t\tlblRecentSearchItem : {\r\n\t\t\t\ttext : popularSearchDataObj.name\r\n\t\t\t},\r\n\t\t\trowName : popularSearchDataObj.name,\r\n\t\t\ttemplate : \"recentSearchListTemplate\",\r\n\t\t};\r\n\t\tpopularSearchListData.push(listRowObj);\r\n\t});\r\n\t$.lvSearchList.sections[0].setHeaderView(addRecentSectionHeader());\r\n\t$.lvSearchList.sections[0].setItems(popularSearchListData);\r\n}\r\n\r\nfunction showSearchList(searchList) {\r\n\t_.each(searchList, function(searchListObj) {\r\n\t\tvar listRowObj = {\r\n\t\t\tlblSearchItem : {\r\n\t\t\t\ttext : searchListObj.name\r\n\t\t\t},\r\n\t\t\trowName : searchListObj.name,\r\n\t\t\tproperties : {\r\n\t\t\t\tsearchableText : searchListObj.name,\r\n\t\t\t},\r\n\t\t\ttemplate : \"searchListTemplate\"\r\n\t\t};\r\n\t\tsearchListData.push(listRowObj);\r\n\t});\r\n\t//$.lvSearchList.sections[0].setHeaderView(addSearchSectionHeader());\r\n\t//$.lvSearchList.sections[0].setItems(searchListData);\r\n}\r\n\r\nfunction searchAction(e) {\r\n\t$.lvSearchList.searchText = e.value;\r\n\tif (e.value.length > 0) {\r\n\t\tshowListView(true);\r\n\t} else {\r\n\t\tshowListView(false);\r\n\t}\r\n}\r\n\r\nfunction showListView(isSearchData) {\r\n\t//$.lvSearchList.sections[0].setHeaderView(addSearchSectionHeader());\r\n\tif (isSearchData) {\r\n\t\t$.lvSearchList.sections[0].setHeaderView(addSearchSectionHeader());\r\n\t\t$.lvSearchList.sections[0].setItems(searchListData);\r\n\t} else {\r\n\t\t$.lvSearchList.sections[0].setHeaderView(addRecentSectionHeader());\r\n\t\t$.lvSearchList.sections[0].setItems(popularSearchListData);\r\n\t}\r\n}\r\n\r\nfunction addRecentSectionHeader() {\r\n\tvar headerView = Ti.UI.createView({\r\n\t\twidth : Titanium.UI.FILL,\r\n\t\theight : 40,\r\n\t\tbackgroundColor : 'white',\r\n\t\tlayout : 'horizontal'\r\n\t});\r\n\tvar leftImage = Ti.UI.createImageView({\r\n\t\twidth : Titanium.UI.SIZE,\r\n\t\theight : Titanium.UI.SIZE,\r\n\t\timage : '/images/customer.png',\r\n\t\tleft : 20,\r\n\t});\r\n\theaderView.add(leftImage);\r\n\tvar title = \"RECENT\";\r\n\tvar lblTitle = Titanium.UI.createLabel({\r\n\t\twidth : Titanium.UI.FILL,\r\n\t\ttext : title,\r\n\t\theight : Titanium.UI.FILL,\r\n\t\tcolor : 'red',\r\n\t\tleft : 20,\r\n\t\tfont : {\r\n\t\t\tfontSize : 16,\r\n\t\t\tfontWeight : 'bold'\r\n\t\t}\r\n\t});\r\n\theaderView.add(lblTitle);\r\n\treturn headerView;\r\n}\r\n\r\nfunction addSearchSectionHeader() {\r\n\tvar headerView = Ti.UI.createView({\r\n\t\twidth : Titanium.UI.FILL,\r\n\t\theight : 40,\r\n\t\tbackgroundColor : 'white',\r\n\t\tlayout : 'horizontal'\r\n\t});\r\n\tvar leftImage = Ti.UI.createImageView({\r\n\t\twidth : Titanium.UI.SIZE,\r\n\t\theight : Titanium.UI.SIZE,\r\n\t\timage : '/images/chassis.png',\r\n\t\tleft : 20,\r\n\t});\r\n\theaderView.add(leftImage);\r\n\tvar title = \"RESULTS\";\r\n\tvar lblTitle = Titanium.UI.createLabel({\r\n\t\twidth : Titanium.UI.FILL,\r\n\t\ttext : title,\r\n\t\theight : Titanium.UI.FILL,\r\n\t\tcolor : 'red',\r\n\t\tleft : 20,\r\n\t\tfont : {\r\n\t\t\tfontSize : 16,\r\n\t\t\tfontWeight : 'bold'\r\n\t\t}\r\n\t});\r\n\theaderView.add(lblTitle);\r\n\treturn headerView;\r\n}\r\n\r\nfunction cancelSearchAction(e) {\r\n\r\n}\r\n\r\n$.index.open();\r\n\r\n{code}\r\n\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\r\n\t\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\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\nFull project ListviewSearch.zip\r\n\r\nPlease take a look on attached screenshot for android and iOS.\r\n\r\nTeste Environment :\r\n{code}\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 = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 7.1.0.GA\r\n{code}\r\n\r\nThanks \r\n", "attachment": [ { "id": "65038", "filename": "ListviewSearch.zip", "author": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "created": "2018-04-10T13:54:43.000+0000", "size": 7903781, "mimeType": "application/zip" }, { "id": "65037", "filename": "Screenshot_20180410-194749.png", "author": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "created": "2018-04-10T13:55:56.000+0000", "size": 84575, "mimeType": "image/png" }, { "id": "65036", "filename": "Screen Shot 2018-04-10 at 7.44.30 PM.png", "author": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "created": "2018-04-10T13:58:18.000+0000", "size": 50912, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Listview setHeaderView with search is not working", "creator": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "subtasks": [], "reporter": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "environment": "Operating 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 = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 7.1.0.GA", "closedSprints": [ { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "436714", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The test case contains many unrelated API's (like multiple item templates). Can you please strip it down to the minimum environment that reproduces this issue? It will speed up further analysis and a possible patch release. One thing I noticed is that the SearchBar is not linked to the ListView, resulting in a non-native behavior. Once linked to the ListView, it is able to adapt to changes of the ListView automatically. See an example (including Alloy) [here|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView-property-searchView].", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-10T15:04:54.000+0000", "updated": "2018-04-10T15:10:35.000+0000" }, { "id": "436759", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The issue looks valid then, thanks [~jnaher]. While we work on a fix, I can think of a quite easy workaround: \r\n# Create a new item template for the header, make it non-clickable and inside an own section for consistency\r\n# Instead of setting the headerview, append or remove the first section\r\n\r\nThis could also enable the possibility of \"fading in\" the header, since you can use animation options when inserting / removing sections, e.g. sliding it down or just without an animation. We can still fix the issue, but this just as a tip how I would implement it. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-11T10:05:46.000+0000", "updated": "2018-04-11T10:05:46.000+0000" }, { "id": "436896", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Simple Test Case -\r\n\r\n\r\n{code:java}\r\n var win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n });\r\n \r\n var list = Ti.UI.createListView({\r\n top: 50,\r\n sections: [Ti.UI.createListSection({\r\n headerTitle:\"Line1\",\r\n items: [{\r\n properties: {\r\n title: \"I\",\r\n searchableText: \"I\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 2\",\r\n searchableText: \"Item 2\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 3\",\r\n searchableText: \"Item 3\",\r\n }\r\n }\r\n ]\r\n }),\r\n Ti.UI.createListSection({\r\n headerTitle:\"Line2\",\r\n \r\n items: [{\r\n properties: {\r\n title: \"I4\",\r\n searchableText: \"I4\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 5\",\r\n searchableText: \"Item 5\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 6\",\r\n searchableText: \"Item 6\",\r\n }\r\n }\r\n ]\r\n })]\r\n })\r\n\r\n var searchBar = Ti.UI.createSearchBar({\r\n top:0,\r\n height:44,\r\n barColor:'#000',\r\n showCancel:true,\r\n });\r\n searchBar.addEventListener('change', function(e){\r\n list.searchText = e.value;\r\n }); \r\n searchBar.addEventListener('return', function(e){\r\n searchBar.blur();\r\n }); \r\n searchBar.addEventListener('cancel', function(e){\r\n searchBar.blur();\r\n });\r\n\r\n win.add(searchBar);\r\n win.add(list);\r\n win.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-16T01:27:36.000+0000", "updated": "2018-04-16T01:27:36.000+0000" }, { "id": "436898", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In iOS for section header to be visible in search result, there is a property [keepSectionsInSearch|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView-property-keepSectionsInSearch].\r\nIf we set this property true, section header will be visible in search result. Default value of this property is false.\r\nPlease check with customer, if setting this property \"true\" resolves the issue. Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-16T04:59:45.000+0000", "updated": "2018-04-16T04:59:45.000+0000" }, { "id": "436910", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks [~vijaysingh] for your help!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-16T09:18:54.000+0000", "updated": "2018-04-16T09:18:54.000+0000" }, { "id": "439856", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closed as completed. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:34:50.000+0000", "updated": "2018-08-06T17:34:50.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }