{ "id": "63267", "key": "TIMOB-2635", "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": "2017-05-02T18:05:08.000+0000", "created": "2011-04-15T03:25:27.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-02T21:13:20.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}

Also the data array count is not incremented and when retrieving\r\nthe data property, it does not contain the items that were\r\nappended

\r\n
\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({  \r\n    backgroundColor:'#fff'\r\n});\r\n\r\nvar item = Ti.UI.createDashboardItem({badge:1, image: \"KS_nav_ui.png\" });\r\nvar dboard = Titanium.UI.createDashboardView( {\r\n  top: 45,\r\n  width: '100%',\r\n  data:[item]\r\n});\r\n\r\n\r\nwin1.add(dboard);\r\nvar button = Titanium.UI.createButton( { title: \"populate\",height:35, top: 2, width: 100 } );\r\nbutton.addEventListener(\"click\", function (e) {\r\n  var item2 = Ti.UI.createDashboardItem({badge:dboard.data.length, image: \"KS_nav_ui.png\" });\r\n  Titanium.API.info(\"Button clicked\");\r\n  dboard.setData([item2]);\r\n  dboard.show();\r\n  Titanium.API.info(\"dboard.data length \"+dboard.data.length);\r\n  Titanium.API.info(\"dboard.data \" + dboard.data);\r\n});\r\nwin1.add(button);\r\nwin1.open();\r\n
{html}", "attachment": [], "flagged": false, "summary": "iOS: DashboardView.setData appears to just append data items to the array", "creator": { "name": "aaronk.saunders", "key": "aaronk.saunders", "displayName": "Aaron K. Saunders", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aaronk.saunders", "key": "aaronk.saunders", "displayName": "Aaron K. Saunders", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129043", "author": { "name": "charlesdaniel", "key": "charlesdaniel", "displayName": "Charles Daniel", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I'd like to second this bug ticket. Looking in the
\n/Library/Application\nSupport/Titanium/mobilesdk/osx/1.5.1/iphone/Classes/TiUIDashboardView.m

\n

under line 50 the setData method

\n
\n-(void)setData:(id)args\n{
\n
\n\n\n
\n
\n
\n[self launcher];\n\nfor (TiUIDashboardItemProxy *proxy in args)\n{\n    ENSURE_TYPE(proxy,TiUIDashboardItemProxy);\n    [launcher addItem:proxy.item animated:NO];\n}\n
\n
\n\n\n
\n}\n
\n

You'll notice that all it ever does is addItem to the\nLauncherView. You can't set DashboardView.data directly to\noverwrite the existing dashboard, all it will ever do is\nappend.

{html}", "updateAuthor": { "name": "charlesdaniel", "key": "charlesdaniel", "displayName": "Charles Daniel", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:27.000+0000", "updated": "2011-04-15T03:25:27.000+0000" }, { "id": "132899", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Also, a feature request to be able to add and remove items programatically.\n\nA helpdesk ticket is asking for this: http://support-admin.appcelerator.com/display/APP-556514\n\nSuggested methods:\n- dashboard.addItem( );\n- dashboard.removeItem( );\n", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-27T19:58:42.000+0000", "updated": "2011-04-27T19:58:42.000+0000" }, { "id": "209771", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed with SDK 2.2.0.014b86f", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-26T14:23:31.000+0000", "updated": "2012-07-26T14:23:31.000+0000" }, { "id": "418652", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-02T18:05:08.000+0000", "updated": "2017-05-02T18:05:08.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }