{ "id": "82288", "key": "TIMOB-5982", "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": "12084", "description": "", "name": "Sprint 2011-44", "archived": true, "released": true, "releaseDate": "2011-11-07" }, { "id": "12571", "description": "CI for 1_7_X", "name": "Release 1.7.6", "archived": true, "released": false }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-04T13:10:24.000+0000", "created": "2011-11-03T12:27:59.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "data", "module_tableviewrow", "qe-testadded" ], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-01-04T13:10:24.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": "I need to get an array of a TableView's rows. I tried two different ways, but both produce errors. They are in the code below. Please note, that while this code is designed to delete a row, that is not the goal in my usage... I need access to the TableViewRow objects themselves. Both examples work in iOS.\r\n\r\n{code:javascript|title=app.js}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar myTableView = Ti.UI.createTableView();\r\n\r\nvar row = Ti.UI.createTableViewRow({\r\n\theight:80,\r\n\tbackgroundColor:'#c00',\r\n});\r\n\r\nmyTableView.appendRow(row);\r\n\r\nwin.add(myTableView);\r\n\r\nwin.addEventListener('open',function(){\r\n\tsetTimeout(function(){\r\n\t\tTi.API.debug(JSON.stringify(myTableView));\r\n\t\tvar tableRows = myTableView.data[0].rows;\r\n\t\tTi.API.debug(JSON.stringify(tableRows));\r\n\t\ttableRows.pop(); // returns the error org.mozilla.javascript.EcmaError: TypeError: Cannot find default value for object.\r\n\t\tmyTableView.data = tableRows;\r\n\t},2000); // two seconds after the window opens, remove the red row\r\n});\r\n\r\n/* you can swap out the open event listener with this one to see my alternative also fail\r\nwin.addEventListener('open',function(){\r\n\tsetTimeout(function(){\r\n\t\tTi.API.debug(JSON.stringify(myTableView));\r\n\t\tvar tableRows = myTableView.sections[0].rows; // returns the error Message: Java class \"java.util.ArrayList\" has no public instance field or method named \"0\".\r\n\t\tTi.API.debug(JSON.stringify(tableRows));\r\n\t\ttableRows.pop();\r\n\t\tmyTableView.data = tableRows;\r\n\t},2000); // two seconds after the window opens, remove the red row\r\n});\r\n*/\r\n\r\nwin.open();\r\n{code}", "attachment": [ { "id": "24029", "filename": "objectType.js", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-03T14:14:59.000+0000", "size": 485, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Can't get access to a TableView's rows (Android)", "creator": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "environment": "Android, using Ti SDK 1.7.3 and 1.7.5 also tested with 1.8.0.v20111101161253", "comment": { "comments": [ { "id": "171392", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Shannon, please leave the assignee field to automatic when creating tickets.\r\nMany thanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-11-03T13:38:02.000+0000", "updated": "2011-11-03T13:38:02.000+0000" }, { "id": "171399", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Android is not returning array when called so error is thrown during compile because of the pop statement. Created a short simple test for drillbit and return type fails", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-03T14:14:23.000+0000", "updated": "2011-11-03T14:14:23.000+0000" }, { "id": "171420", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Natalie\r\n\r\nIf you are aware of this issue, you are welcome to take ownership of the ticket and move it to TiMob.\r\n\r\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-11-03T15:45:32.000+0000", "updated": "2011-11-03T15:45:32.000+0000" }, { "id": "171421", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "oh, my apologies - you have done. Thank you! :)", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-11-03T15:48:08.000+0000", "updated": "2011-11-03T15:48:08.000+0000" }, { "id": "171505", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I would try the following workaround to remove a table row:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar myTableView = Ti.UI.createTableView();\r\n\r\nvar row = Ti.UI.createTableViewRow({\r\n\theight:80,\r\n\tbackgroundColor:'#c00',\r\n});\r\n\r\nmyTableView.appendRow(row);\r\nwin.add(myTableView);\r\n\r\nwin.addEventListener('open',function(){\r\n\tsetTimeout(function(){\r\n\t\tTi.API.debug(JSON.stringify(myTableView));\r\n\t\tvar tableRows = myTableView.data[0].rows;\r\n\t\tTi.API.debug(JSON.stringify(tableRows));\r\n\t\tmyTableView.data[0].remove(row); // returns the error org.mozilla.javascript.EcmaError: TypeError: Cannot find default value for object.\r\n\r\n\t},2000); // two seconds after the window opens, remove the red row\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nYou can also access a single table row via something like:\r\n\r\nmyTableView.data[0].rows[0]", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-04T09:39:49.000+0000", "updated": "2011-11-04T09:39:49.000+0000" }, { "id": "171586", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fixed on 1_7_X.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-04T22:31:12.000+0000", "updated": "2011-11-04T22:31:12.000+0000" }, { "id": "171587", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Needs to be checked on 1.8.0 after v8 merge.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-04T22:32:15.000+0000", "updated": "2011-11-04T22:32:15.000+0000" }, { "id": "172087", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Looks to have been resolved with V8 changes. I don't believe this patch\r\nis required now after v8 merge.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-09T16:11:07.000+0000", "updated": "2011-11-09T16:11:07.000+0000" }, { "id": "172197", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Function test for 1.8.0.1 passed.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-10T13:03:59.000+0000", "updated": "2011-11-10T13:03:59.000+0000" }, { "id": "175125", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.1.v20111205164258 v8/rhino on\r\nGalaxy 10.1 (3.1)\r\nDroid 1 (2.2.2)\r\nNexus S (2.3.6)\r\nEmulator (4.0)", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-06T17:56:22.000+0000", "updated": "2011-12-06T17:56:22.000+0000" }, { "id": "178000", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Open to add label", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-04T13:10:03.000+0000", "updated": "2012-01-04T13:10:03.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }