{ "id": "107059", "key": "TIMOB-12424", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-03-19T15:38:10.000+0000", "created": "2012-12-23T15:40:40.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "exalture" ], "versions": [], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2017-03-22T21:13:56.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": "h6.Issue\r\nIf trying to add a view to a tableviewrow after view creation, then nothing happen. Which would also mean a potential memory leak\r\n\r\nUse the testcase, click on row. A view should be added nothing happens. If you change and the view to row.view, then it works\r\n\r\nh6.Tested on\r\nTested on physical device(Galaxy S2 - 4.2) and Android simulator 4.0\r\n\r\nh6.Repro sequence\r\n{code}\r\nvar win = Titanium.UI.createWindow();\r\nwin.backgroundColor = '#ccc';\r\n\r\nvar tableview = Ti.UI.createTableView();\r\nwin.add(tableview);\r\n\r\nvar rowData = [];\r\nfor (var i = 0; i < 10; i++) {\r\n var row = Ti.UI.createTableViewRow({\r\n title : 'row ' + i,\r\n height:90,\r\n name : 'row ' + i\r\n });\r\n row.view = Ti.UI.createView({\r\n \tleft:0,\r\n \tright:0,\r\n \ttop:0,\r\n \tbottom:0,\r\n backgroundColor:'blue'\r\n })\r\n row.add(row.view);\r\n rowData.push(row);\r\n};\r\ntableview.data = rowData;\r\n\r\ntableview.addEventListener('click', function(e) {\r\n if(e.row)\r\n {\r\n \tTi.API.info('testing ')\r\n \tif (!e.row.menu || e.row.menu === null){\r\n\t\t\te.row.menu = Ti.UI.createView({\r\n\t\t width:50,\r\n\t\t right:0,\r\n\t\t backgroundColor:'black'\r\n\t\t })\r\n\t\t e.row.add(e.row.menu);\r\n\t }\r\n\t else {\r\n\t\t e.row.remove(e.row.menu);\r\n\t\t e.row.menu = null;\r\n\t }\r\n }\r\n})\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: View can't be added to tableViewRow issue", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "Titanium 3.1.0 master CI builds\r\nAndroid SDK 4.2 - API Level 17", "comment": { "comments": [ { "id": "235801", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "@Martin Guillon Please check [JIRA Ticket Checklist|http://docs.appcelerator.com/titanium/latest/#!/guide/How_to_Submit_a_Bug_Report-section-29004732_HowtoSubmitaBugReport-JIRATicketChecklist] and complete this issue. As the ticket misses crucial information that must be included in order for a ticket to be accepted.", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-24T23:13:55.000+0000", "updated": "2013-01-24T23:13:55.000+0000" }, { "id": "235857", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "@Eduardo: may be you could tell me what s missing ? I have put a testcase, an android version to test it. What \"critical\" information are you missing?", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-01-25T07:58:47.000+0000", "updated": "2013-01-25T07:58:47.000+0000" }, { "id": "235869", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Edit: updated labels and format.", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-25T13:31:52.000+0000", "updated": "2013-01-25T17:40:57.000+0000" }, { "id": "242913", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I don't think there is anything wrong here other than the height is not specified for the view. Either give the height or set top and bottom to 0 to occupy the entire row height. Something like\r\n e.row.menu = Ti.UI.createView({\r\n\t\t\t width:50,\r\n\t\t\t right:0,\r\n\t\t\t bottom:0,\r\n\t\t\t top:0,\r\n\t\t\t backgroundColor:'black'\r\n\t\t\t })", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-03-19T15:38:10.000+0000", "updated": "2013-03-19T15:38:10.000+0000" }, { "id": "242926", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "And so what does it behave differently if you add it to the row or to row.view?", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-03-19T16:51:01.000+0000", "updated": "2013-03-19T16:51:01.000+0000" }, { "id": "414968", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T21:13:56.000+0000", "updated": "2017-03-22T21:13:56.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }