{ "id": "80494", "key": "TIMOB-5813", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2011-12-09T12:15:09.000+0000", "created": "2011-09-22T07:42:40.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "11971", "description": "iOS5 and select Android fixes", "name": "Release 1.7.3", "archived": true, "released": true, "releaseDate": "2011-10-18" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-23T18:40: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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Greetings,\r\n\r\nI have created a TableView, added a handful of rows then update one of those rows. The problem is that the wrong row or rows are being updated. If I turn the phone on the side and then back again, the rows show the correct information. I found that if I do not add \"className\" then it works fine. However I am under the impression that \"className\" is utilized internally to improve performance.\r\n\r\nWe are also having problems with wrong check boxes on rows being updated. I wonder if this is related.\r\n\r\nThe following code reproduces the issue. I have simplified everything, removing all of the complexities of my actual application.\r\n\r\n{code:javascript|app.js}\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win1 = Titanium.UI.createWindow({title:'Window 1'});\r\nvar TheListBox=Ti.UI.createTableView();\r\nwin1.add(TheListBox);\r\n\r\nwin1.addEventListener('open',OnLoad);\r\nfunction OnLoad()\r\n{\r\n function AddRow(_Caption)\r\n {\r\n _Caption = String(_Caption);\r\n\r\n // This works!\r\n// var RowObj=Ti.UI.createTableViewRow({title:_Caption});\r\n\r\n // This causes the wrong row or rows to be updated! \r\n var RowObj=Ti.UI.createTableViewRow({className:'Anything here causes the problem!', title:_Caption});\r\n \r\n RowObj.Label=Ti.UI.createLabel({text:_Caption});\r\n RowObj.add(RowObj.Label);\r\n TheListBox.appendRow(RowObj);\r\n }\r\n\r\n for (i=1;i<=10;i++)\r\n AddRow(i);\r\n}\r\n\r\n function OnTimeout()\r\n {\r\n TheListBox.data[0].rows[5].Label.text = 'OnTimeout';\r\n }\r\nvar TheTimer = setInterval(OnTimeout, 2000);\r\n\r\nwin1.open();\r\n{code}\r\n\r\nIn the above example, the row labeled '6' should show 'OnTimeout', all the reset should show 1-9. The 6th row does show 'OnTimeout' correctly however, the 8th row also shows 'OnTimeout', which is incorrect.\r\n\r\nTurn the phone on the side and the rows will magically be displayed correctly!\r\n\r\nChange the code as follow and it works fine...\r\n\r\n{code:javascript|app.js}\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win1 = Titanium.UI.createWindow({title:'Window 1'});\r\nvar TheListBox=Ti.UI.createTableView();\r\nwin1.add(TheListBox);\r\n\r\nwin1.addEventListener('open',OnLoad);\r\nfunction OnLoad()\r\n{\r\n function AddRow(_Caption)\r\n {\r\n _Caption = String(_Caption);\r\n\r\n // This works!\r\n var RowObj=Ti.UI.createTableViewRow({title:_Caption});\r\n\r\n // This causes the wrong row or rows to be updated! \r\n// var RowObj=Ti.UI.createTableViewRow({className:'Anything here causes the problem!', title:_Caption});\r\n \r\n RowObj.Label=Ti.UI.createLabel({text:_Caption});\r\n RowObj.add(RowObj.Label);\r\n TheListBox.appendRow(RowObj);\r\n }\r\n\r\n for (i=1;i<=10;i++)\r\n AddRow(i);\r\n}\r\n\r\n function OnTimeout()\r\n {\r\n TheListBox.data[0].rows[5].Label.text = 'OnTimeout';\r\n }\r\nvar TheTimer = setInterval(OnTimeout, 2000);\r\n\r\nwin1.open(); \r\n{code}\r\n\r\nThe only difference is that \"className\" is not set!", "attachment": [], "flagged": false, "summary": "TableView issue with className - Wrong row(s) updated!", "creator": { "name": "peteberry@ewrinc.com", "key": "peteberry@ewrinc.com", "displayName": "Pete Berry", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "peteberry@ewrinc.com", "key": "peteberry@ewrinc.com", "displayName": "Pete Berry", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium Studio, build: 1.0.4.201108101535\r\nSDK: 1.7.3.v20110826161351\r\nGoogle APIs Android 2.2\r\n", "comment": { "comments": [ { "id": "175571", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Unable to reproduce with latest master on both v8/rhino", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-09T12:12:30.000+0000", "updated": "2011-12-09T12:15:32.000+0000" }, { "id": "188146", "author": { "name": "peteberry@ewrinc.com", "key": "peteberry@ewrinc.com", "displayName": "Pete Berry", "active": true, "timeZone": "America/New_York" }, "body": "Good morning,\r\nWe tested with Mobile SDK 2.0.0.v20120319003254 and the problem appears to be fixed.\r\nCheers,\r\nPete", "updateAuthor": { "name": "peteberry@ewrinc.com", "key": "peteberry@ewrinc.com", "displayName": "Pete Berry", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-23T04:34:01.000+0000", "updated": "2012-03-23T04:34:01.000+0000" }, { "id": "415340", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket with reference to the previous comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T18:40:21.000+0000", "updated": "2017-03-23T18:40:21.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }