{ "id": "79921", "key": "TIMOB-5509", "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": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-09-08T04:41:25.000+0000", "created": "2011-09-01T03:09:32.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-port" ], "versions": [], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-08-28T10:50:47.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": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "After one call of tableView.setData([]) the tableView becomes unavailable for adding new rows by methods tableView.appendRow() or tableView.setData(data).\r\nHow to reproduce: Run example > click \"Fill table\" > click \"Clear Table\" > click \"Fill table\". \r\nExpected behavior: tableview should be filled by rows after second click against the \"Fill table\" button. \r\n\r\n{code:javascript}\r\nvar win = Ti.UI.currentWindow;\r\nwin.backgroundColor = '#EEE';\r\n\r\nvar tableView = Ti.UI.createTableView({\r\n\twidth: 300,\r\n\theight: 200,\r\n\ttop: 155,\r\n\tleft: 10,\r\n\tbackgroundColor: '#AAA'\r\n});\r\n\r\nvar addRow = Ti.UI.createButton({\r\n\ttitle: 'Clear table',\r\n\twidth: 140,\r\n\ttop:5,\r\n\tleft: 10,\r\n\theight: 50,\r\n\tfontSize: 16\r\n});\r\n\r\nvar delRow = Ti.UI.createButton({\r\n\ttitle: 'Delete row',\r\n\twidth: 140,\r\n\ttop:5,\r\n\theight: 50,\r\n\tleft: 160,\r\n\tfontSize: 16\r\n});\r\nvar fillTable = Ti.UI.createButton({\r\n\ttitle: 'Fill table',\r\n\twidth: 140,\r\n\theight: 50,\r\n\ttop:60,\r\n\tleft: 10,\r\n\tfontSize: 16\r\n});\r\n\r\nvar label1 = Ti.UI.createLabel({\r\n\ttop: 115,\r\n\tleft: 53,\r\n\twidth: 100,\r\n\theight: 30,\r\n\ttext: 'Row index:',\r\n\t\r\n});\r\n\r\n\r\nvar tf1= Ti.UI.createTextField({\r\n\twidth: 50,\r\n\theight: 30,\r\n\ttop:115,\r\n\tbackgroundColor:'white',\r\n\tleft: 178,\r\n\tvalue: '1'\r\n});\r\n\r\nvar closeButton = Ti.UI.createButton({\r\n\ttitle:'Close Window',\r\n\theight:50,\r\n\twidth:140,\r\n\ttop:60,\r\n\tleft:160,\r\n\tfontSize: 16\r\n});\r\n\r\ncloseButton.addEventListener('click', function(){\r\n\tTitanium.UI.currentWindow.close();\r\n});\r\n\r\n\r\n\r\nwin.add(closeButton);\r\nwin.add(fillTable);\r\nwin.add(tableView);\r\nwin.add(addRow);\r\nwin.add(delRow);\r\nwin.add(tf1);\r\nwin.add(label1);\r\n\r\n\r\n\r\nvar i = 1;\r\nvar newRow = function (){\r\n\trow = Ti.UI.createTableViewRow({\r\n\t\ttitle: 'This is row #' + i\r\n\t});\r\n\ti++;\r\n};\r\n\r\naddRow.addEventListener('click', function(){\r\n\ttableView.setData([]);\r\n//\tnewRow();\r\n//\ttableView.appendRow(row);\r\n});\r\n\r\ndelRow.addEventListener('click', function(){\r\n\ttableView.deleteRow(parseInt(tf1.value)-1);\r\n});\r\n\r\n\r\nfillTable.addEventListener('click',function(){\r\n\tvar data = [{title:'This is row #1'},\r\n\t\t\t\t{title:'This is row #2'},\r\n\t\t\t\t{title:'This is row #3'},\r\n\t\t\t\t{title:'This is row #4'},\r\n\t\t\t\t{title:'This is row #5'}];\r\n\ti=6;\r\n\ttableView.setData(data);\r\n});\r\n{code} ", "attachment": [], "flagged": false, "summary": "MobileWeb: Method tableView.setData([]) works only once. ", "creator": { "name": "mvasko", "key": "mvasko", "displayName": "Misha Vasko", "active": true, "timeZone": "Europe/Kiev" }, "subtasks": [], "reporter": { "name": "mvasko", "key": "mvasko", "displayName": "Misha Vasko", "active": true, "timeZone": "Europe/Kiev" }, "environment": null, "comment": { "comments": [ { "id": "164746", "author": { "name": "mvasko", "key": "mvasko", "displayName": "Misha Vasko", "active": true, "timeZone": "Europe/Kiev" }, "body": "Method tableview.setData() should reset the previous data in the tableview. Now it adds the new data to the end of tableview.", "updateAuthor": { "name": "mvasko", "key": "mvasko", "displayName": "Misha Vasko", "active": true, "timeZone": "Europe/Kiev" }, "created": "2011-09-01T05:52:21.000+0000", "updated": "2011-09-01T05:52:21.000+0000" }, { "id": "216462", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fix on:\r\nTitanium studio : 2.1.1.201207271312\r\nSDK version : 2.2.0.v20120827143312\r\nChrome 21.0.xx\r\nFirefox 15\r\nSafari 6.0\r\nAndroid 4.0.4 default browser,chrome 18.0.xx ,firefox 15.0\r\nIphone 5.0.1 mobile safari", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-08-28T10:50:47.000+0000", "updated": "2012-08-28T10:50:47.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }