{ "id": "60762", "key": "TIMOB-130", "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": "11213", "name": "Release 0.7.0", "archived": true, "released": true, "releaseDate": "2009-10-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:52:05.000+0000", "created": "2011-04-15T02:24:06.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "compositeview" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:52:05.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": "{html}

Purpose

\n

Composite views are made up of one or more views (i.e., WebView,\nGroupedView, TableView, or ScrollableView). Composite Views allow\nyou to absolutely size and position views on the page.

\n

See this discussion for more background:

\n

\nhttps://appcelerator.lighthouseapp.com/projects/32238/tickets/125-l...

\n

API Spec

\n
\n\n//Set up views\nvar table = Titanium.UI.createTableView(...);\nvar webView = Titanium.UI.createWebView(...);\nvar webView2 = Titanium.UI.createWebView(...);\nvar webView3 = Titanium.UI.createWebView(...);\n\n// create composite view\nvar compositeView = Titanium.UI.createCompositeView();\n\n// add views \ncompositeView.addView(webView,{y:0,height:100});\ncompositeView.addView(webView2,{height:100});\ncompositeView.addView(table,{y:100, height:50});\ncompositeView.addView(webView3,{x:60,y:300,width:150,height:50,zIndex:2});\n\n//\n// Notes: \n// - if no width is provided, the assumption is 100%\n// - height should be required\n// - zIndex enables layering of views\n\n// add view\nTitanium.UI.currentWindow.addView(compositeView);\n\n// show view\nTitanium.UI.currentWindow.showView(compositeView);\n
{html}", "attachment": [], "flagged": false, "summary": "API - Composite Views", "creator": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "122814", "author": { "name": "pawanpoudel", "key": "pawanpoudel", "displayName": "Pawan Poudel", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi,

\n

I am trying to update the content of a tableview inside a\ncomposite view. I created a new table view with updated data and\nreplaced the original table view since I couldn't find a way to\nupdate the \"data\" property of the original tableview. Please see\nthe code below. Even though it works for me, there must be a better\nway to do this. Please advise.

\n
\nfunction updateTableViewInsideCompositeView() {\n  // create a new table view since I don't know \n  // how to update the tableview data\n  var updatedTable = Titanium.UI.createTableView({data:newData},function({}));  \n\n  // get views\n  var views = Titanium.UI.currentWindow.getViews();\n    \n  // create a new composite view\n  var newCompositeView = Titanium.UI.createCompositeView();\n    \n  // add views \n  newCompositeView.addView(webView,{y:0,height:100});\n  newCompositeView.addView(webView2,{height:100});\n  newCompositeView.addView(updatedTable,{y:100, height:50});\n  newCompositeView.addView(webView3,{x:60,y:300,width:150,height:50,zIndex:2});\n    \n  // add view\n  Titanium.UI.currentWindow.addView(newCompositeView);\n\n  // show view\n  Titanium.UI.currentWindow.showView(newCompositeView);\n}\n
\n

Thank you very much,
\nPawan Poudel

{html}", "updateAuthor": { "name": "pawanpoudel", "key": "pawanpoudel", "displayName": "Pawan Poudel", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:24:07.000+0000", "updated": "2011-04-15T02:24:07.000+0000" }, { "id": "122815", "author": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

you can update a table view. see Kitchen Sink -
\ntableview_update.html (you can also insert new rows, delete\nrows,
\nappend rows, and reset the data for the entire table view)

{html}", "updateAuthor": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:24:07.000+0000", "updated": "2011-04-15T02:24:07.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }