{ "id": "106593", "key": "TIMOB-13434", "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": "15400", "description": "2013 Sprint 08 API", "name": "2013 Sprint 08 API", "archived": true, "released": true, "releaseDate": "2013-04-22" }, { "id": "15106", "description": "2013 Sprint 08", "name": "2013 Sprint 08", "archived": true, "released": true, "releaseDate": "2013-04-22" }, { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-04-17T23:19:07.000+0000", "created": "2012-12-15T20:29:46.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-closed-3.1.1", "qe-testadded", "regression", "triage" ], "versions": [], "issuelinks": [ { "id": "31901", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "119917", "key": "TIMOB-15204", "fields": { "summary": "iOS7: Contents flash during refresh of TableViewRow", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-16T12:43:22.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": "If you set the hasCheck property on a tableViewRow on a click event, then the highlightedColor on any labels within that tableViewRow gets stuck.\r\n\r\n{code:javascript}\r\ntableview.addEventListener('click', function(e) {\r\n currRow.setHasCheck(false);\r\n currRow.label.setColor('#000');\r\n currRow = e.row;\r\n e.row.setHasCheck(true);\r\n e.row.label.setColor('#324f85');\r\n});\r\n{code}\r\n\r\nThe label within that row has a highlightedColor of #fff. When clicking on a row, the label turns permanently white. Selecting it again fixes the problem.\r\n\r\nA workaround is to call setHasCheck twice, while setting the font color explicitly in between the two calls:\r\n\r\n{code:javascript}\r\ntableview.addEventListener('click', function(e) {\r\n currRow.setHasCheck(false);\r\n currRow.label.setColor('#000');\r\n currRow = e.row;\r\n e.row.setHasCheck(true);\r\n e.row.label.setColor('#324f85');\r\n // need to set hasCheck again to get around Titanium 3.0.0 bug\r\n e.row.setHasCheck(true);\r\n});\r\n{code}\r\n\r\nThis will still cause the same bug if the row is selected twice in a row now. To work around that, you have to make sure that this row isn't already selected.\r\n\r\nThis bug was introduced in Titanium 3.0.0. I am building using the iOS 6 sdk with Titanium Studio 3.0. The problem exists in both the simulator and on a physical iPhone 5 device.", "attachment": [], "flagged": false, "summary": "iOS: TableViewRow .hasCheck bug when used in combination with highlightedColor", "creator": { "name": "neilgupta", "key": "neilgupta", "displayName": "Neil Gupta", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "neilgupta", "key": "neilgupta", "displayName": "Neil Gupta", "active": true, "timeZone": "America/Chicago" }, "environment": "Mac OS X 10.8.2\r\niOS SDK 6.0\r\nTitanium Studio 3.0, Titanium 3.0.0", "comment": { "comments": [ { "id": "242037", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Neil Gupta : could you provide us with better test case(a more detailed one). We are having a tough time testing this code. It would be good if we can understand the case that you are trying to do. ", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-13T18:33:22.000+0000", "updated": "2013-03-13T18:33:22.000+0000" }, { "id": "242148", "author": { "name": "neilgupta", "key": "neilgupta", "displayName": "Neil Gupta", "active": true, "timeZone": "America/Chicago" }, "body": "Basically, the problem occurs when tapping a row and setting hasCheck to true. However, the color of the label gets stuck to whatever highlightedColor is. Here is the full code block I am using. I haven't tested if this code works without the workaround in 3.0.2.\n{code:javascript}\n var createTableRow = function(sub) {\n\t\tvar row = Ti.UI.createTableViewRow({\n\t\t\tclassName: 'calendarselrow',\n\t\t\tlayout: 'horizontal'\n\t\t});\n\t\trow.color = sub.color;\n\t\trow.name = sub.group.fullName;\n\t\trow.groupId = sub.group.id;\n\t\tvar calColor = Ti.UI.createView({\n\t\t\tleft: 8,\n\t\t\ttop: 12,\n\t\t\twidth: 14,\n\t\t\theight: 14,\n\t\t\tborderRadius: 7,\n\t\t\tborderWidth: 1,\n\t\t\tborderColor: ta.colorLuminance(sub.color, -0.3),\n\t\t\tbackgroundGradient:{type:'linear',\n\t\t\t\tcolors:[sub.color, ta.colorLuminance(sub.color, -0.2)],\n\t\t\t\tstartPoint:{x:0,y:0},\n\t\t\t\tendPoint:{x:2,y:14},\n\t\t\t\tbackFillStart:false},\n\t\t\ttouchEnabled: false\n\t\t})\n\t\t, calLabel = Ti.UI.createLabel({\n\t\t\ttext: sub.group.fullName,\n\t\t\tcolor: '#000',\n\t\t\thighlightedColor: '#fff',\n\t\t\tleft: 4,\n\t\t\theight: 40,\n\t\t\ttouchEnabled: false,\n\t\t\tfont: {fontWeight: 'bold', fontSize: 18}\n\t\t})\n\t\t, calSubLabel = Ti.UI.createLabel({\n\t\t\ttext: sub.group.course.name),\n\t\t\tleft: 10,\n\t\t\theight: 40,\n\t\t\tcolor: '#7a7a7a',\n\t\t\thighlightedColor: '#fff',\n\t\t\ttouchEnabled: false,\n\t\t\tfont: {fontSize: 12}\n\t\t});\n\t\trow.label = calLabel;\n\t\trow.subLabel = calSubLabel;\n\t\trow.add(calColor);\n\t\trow.add(calLabel);\n\t\trow.add(calSubLabel);\n\t\tif (groupId == sub.group.id) {\n\t\t\trow.setHasCheck(true);\n\t\t\tcalLabel.color = '#324f85';\n\t\t\tcalSubLabel.color = '#819ccf';\n\t\t\tcurrRow = row;\n\t\t\tcolor = sub.color;\n\t\t\tname = sub.group.fullName;\n\t\t}\n\t\treturn row;\n\t}\n\t\n\ttableview.addEventListener('click', function(e) {\n\t\tif (e.row.className === 'noCoursesRowInSelection' || e.row.className === 'coursesInstructional')\n\t\t\treturn;\n\t\tif (groupId !== e.rowData.groupId) {\n\t\t\tcolor = e.rowData.color;\n\t\t\tname = e.rowData.name;\n\t\t\tgroupId = e.rowData.groupId;\n\t\t\tcurrRow.setHasCheck(false);\n\t\t\tcurrRow.label.setColor('#000');\n\t\t\tcurrRow.subLabel.setColor('#7a7a7a');\n\t\t\tcurrRow = e.row;\n\t\t\te.row.setHasCheck(true);\n\t\t\te.row.label.setColor('#324f85');\n\t\t\te.row.subLabel.setColor('#819ccf');\n\t\t\t// need to set hasCheck again to get around Titanium 3.0.0 bug\n\t\t\te.row.setHasCheck(true);\n\t\t}\n\t});\n{code}", "updateAuthor": { "name": "neilgupta", "key": "neilgupta", "displayName": "Neil Gupta", "active": true, "timeZone": "America/Chicago" }, "created": "2013-03-14T01:10:57.000+0000", "updated": "2013-03-14T01:10:57.000+0000" }, { "id": "246179", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "row.hasCheck triggers row update and should be called last.", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-06T20:09:20.000+0000", "updated": "2013-04-06T20:09:20.000+0000" }, { "id": "247321", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This the code I am using for testing\n{code}\nvar win = Ti.UI.createWindow({backgroundColor:'white'});\n\nvar tableView = Ti.UI.createTableView();\n\nvar createTableRow = function(sub) {\n var row = Ti.UI.createTableViewRow({\n className: 'calendarselrow',\n layout: 'horizontal'\n });\n row.color = sub.color;\n row.name = sub.group.fullName;\n row.groupId = sub.group.id;\n var calColor = Ti.UI.createView({\n left: 8,\n top: 12,\n width: 14,\n height: 14,\n borderRadius: 7,\n borderWidth: 1,\n touchEnabled: false\n })\n , calLabel = Ti.UI.createLabel({\n text: sub.group.fullName,\n color: '#000',\n highlightedColor: '#fff',\n left: 4,\n height: 40,\n touchEnabled: false,\n font: {fontWeight: 'bold', fontSize: 18}\n })\n , calSubLabel = Ti.UI.createLabel({\n text: sub.group.course.name,\n left: 10,\n height: 40,\n color: '#7a7a7a',\n highlightedColor: '#fff',\n touchEnabled: false,\n font: {fontSize: 12}\n });\n row.label = calLabel;\n row.subLabel = calSubLabel;\n row.add(calColor);\n row.add(calLabel);\n row.add(calSubLabel);\n if (groupId == sub.group.id) {\n row.setHasCheck(true);\n calLabel.color = '#324f85';\n calSubLabel.color = '#819ccf';\n currRow = row;\n color = sub.color;\n name = sub.group.fullName;\n }\n return row;\n}\n\nvar currRow = null;\nvar groupId = null; \ntableView.addEventListener('click', function(e) {\n if (e.row.className === 'noCoursesRowInSelection' || e.row.className === 'coursesInstructional')\n return;\n if (groupId !== e.rowData.groupId) {\n color = e.rowData.color;\n name = e.rowData.name;\n groupId = e.rowData.groupId;\n if(currRow != null){\n currRow.setHasCheck(false);\n currRow.label.setColor('#000');\n currRow.subLabel.setColor('#7a7a7a');\n }\n currRow = e.row;\n e.row.setHasCheck(true);\n e.row.label.setColor('#324f85');\n e.row.subLabel.setColor('#819ccf');\n }\n});\n\n\nvar data = [];\n\nfor(i=1;i<50;i++) {\n var sub1 = {color:'blue',group:{fullName:'Group '+i,id:i,course:{name:'Course '+i}}};\n data.push(createTableRow(sub1))\n}\n\ntableView.setData(data);\n\nwin.add(tableView);\n\nwin.open();\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-12T18:53:27.000+0000", "updated": "2013-04-12T18:53:27.000+0000" }, { "id": "247629", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4163", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-15T20:31:53.000+0000", "updated": "2013-04-15T20:31:53.000+0000" }, { "id": "248066", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR ", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-17T23:19:07.000+0000", "updated": "2013-04-17T23:19:07.000+0000" }, { "id": "248653", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport to 3_1_X\nhttps://github.com/appcelerator/titanium_mobile/pull/4204", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-22T18:51:48.000+0000", "updated": "2013-04-22T18:51:48.000+0000" }, { "id": "249444", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with:\nMac 10.8.3 Mountain Lion\nAppcelerator Studio, build: 3.1.1.201304281105\nSDK, build: 3.1.1.v20130429105103\nDevices:\niPhone5 iOS 6.1.3\niPad mini iOS iOS 6.0\n\nActual result:\nClicking table view row, highlights it, and check mark is visible.", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-29T21:43:40.000+0000", "updated": "2013-04-29T21:43:40.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }