{ "id": "63866", "key": "TIMOB-3234", "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-02T20:12:18.000+0000", "created": "2011-04-15T03:40:06.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:19:14.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}

Overview

\r\n

When creating custom dashboard items that don't correspond to\r\nthe \"hard coded\" size restrictions within the Dashboard Module,\r\nevents associated with the Dashboard Items are not fired in the\r\ncorrect spots or at all.

\r\n

Technical Information

\r\n

Titanium Mobile SDK: 1.5.x and above

\r\n

Environment: iPad Simulator

\r\n

iOS SDK: 4.1 && 4.2

\r\n

Expected Result:

\r\n

Clicking on the Dashboard Item should fire the coded Event

\r\n

Actual Result:

\r\n

Event is not fired at all or is triggered in the wrong place

\r\n

Code Sample:

\r\n
\r\n\r\nvar win = Ti.UI.currentWindow;\r\n\r\nvar data = [\r\n    {id: 0, title: 'test1', image:'image.png'},\r\n    {id: 1, title: 'test2', image: 'image.png'},\r\n    {id: 2, title: 'test3', image:'image.png'},\r\n    {id: 3, title: 'test4', image:'image.png'},\r\n    {id: 4, title: 'test5', image:'image.png'},\r\n    {id: 5, title: 'test6', image:'image.png'},\r\n    {id: 6, title: 'test7', image:'image.png'},\r\n    {id: 7, title: 'test8', image:'image.png'},\r\n    {id: 8, title: 'test9', image:'image.png'},\r\n    {id: 9, title: 'test10', image:'image.png'},\r\n    {id: 10, title: 'test11', image:'image.png'},\r\n    {id: 11, title: 'test12', image:'image.png'},\r\n    {id: 12, title: 'test13', image:'image.png'}\r\n];\r\n\r\n\r\nvar background = Ti.UI.createView({\r\n    backgroundImage: '../images/bkg.png'\r\n});\r\n\r\nvar dashboardItems = [];\r\nvar t = 0;\r\nfor(var i=0, j=data.length; i < j; i++){\r\n    \r\n    var label = Ti.UI.createLabel({\r\n        text: data[i].title,\r\n        font: {\r\n            fontSize: 12,\r\n            fontFamily: 'Helvetica',\r\n            fontWeight: 'bold' \r\n        },\r\n        shadowColor: '#333',\r\n        shadowOffset: {x:1, y:1},\r\n        color: '#fff',\r\n        width: 130,\r\n        textAlign: 'center',\r\n        top: 210\r\n    });\r\n    \r\n    var icon = Ti.UI.createImageView({\r\n        image: '../images/'+ data[i].image,\r\n        width: 130,\r\n        height: 'auto'\r\n    });\r\n    \r\n    var item = Ti.UI.createDashboardItem({\r\n        title: data[i].id,\r\n        canDelete: false,\r\n        top: t,\r\n        width: 140,\r\n        height: 230,\r\n        zIndex: 100,\r\n        touchEnabled: true\r\n    });\r\n    \r\n    item.addEventListener('click', function(e){\r\n        //This never gets hit - event isn't getting called\r\n               Ti.API.info('HELLOOO');\r\n    });\r\n    \r\n    item.add(icon);\r\n    item.add(label);\r\n    dashboardItems.push(item);  \r\n     \r\n    //Goofy stuff i have to do to make custom Dashboard Items show properly on the iPad in landscape mode\r\n    if((i+1) % 3 == 0) { \r\n        if( i % 8 == 0) { t=0; Ti.API.info('Top: '+t); continue;}\r\n        t+=125; \r\n        Ti.API.info('Top: '+t);\r\n        Ti.API.info('Mod: '+ i%3);\r\n    }\r\n\r\n        // Debug Info for the DashboardItem positioning\r\n    Ti.API.info('Top: '+t);\r\n    Ti.API.info('Mod: '+ i%3);\r\n}\r\n\r\nvar dasboard = Ti.UI.createDashboardView({\r\n    title: 'dashboard',\r\n    data: dashboardItems,\r\n    touchEnabled: true,\r\n    wobble: false,\r\n    height: 768,\r\n    width: 900,\r\n    top: 10\r\n});\r\n\r\nwin.add(background);\r\nwin.add(dashboard);\r\n
{html}", "attachment": [], "flagged": false, "summary": "iOS: Dashboard Events do not trigger correctly with custom Dashboard Items [iPad]", "creator": { "name": "bert", "key": "bert", "displayName": "Bert", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bert", "key": "bert", "displayName": "Bert", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "217460", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested on the iOS simulator using TiSDK 2.2.0v20120904101713, issue still valid. \r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\n\r\nvar data = [\r\n {id: 0, title: 'test1', image:'image.jpg'},\r\n {id: 1, title: 'test2', image:'image.jpg'},\r\n {id: 2, title: 'test3', image:'image.jpg'},\r\n {id: 3, title: 'test4', image:'image.jpg'},\r\n {id: 4, title: 'test5', image:'image.jpg'},\r\n {id: 5, title: 'test6', image:'image.jpg'},\r\n {id: 6, title: 'test7', image:'image.jpg'},\r\n {id: 7, title: 'test8', image:'image.jpg'},\r\n {id: 8, title: 'test9', image:'image.jpg'},\r\n {id: 9, title: 'test10', image:'image.jpg'},\r\n {id: 10, title: 'test11', image:'image.jpg'},\r\n {id: 11, title: 'test12', image:'image.jpg'},\r\n {id: 12, title: 'test13', image:'image.jpg'}\r\n];\r\n\r\n\r\nvar background = Ti.UI.createView({\r\n backgroundImage: 'KS_nav_ui.png'\r\n});\r\n\r\nvar dashboardItems = [];\r\nvar t = 0;\r\nfor(var i=0, j=data.length; i < j; i++){\r\n \r\n var label = Ti.UI.createLabel({\r\n text: data[i].title,\r\n font: {\r\n fontSize: 12,\r\n fontFamily: 'Helvetica',\r\n fontWeight: 'bold' \r\n },\r\n shadowColor: '#333',\r\n shadowOffset: {x:1, y:1},\r\n color: '#fff',\r\n width: 130,\r\n textAlign: 'center',\r\n top: 210\r\n });\r\n \r\n var icon = Ti.UI.createImageView({\r\n image: data[i].image,\r\n width: 130,\r\n height: 'auto'\r\n });\r\n \r\n var item = Ti.UI.createDashboardItem({\r\n title: data[i].id,\r\n canDelete: false,\r\n top: t,\r\n width: 140,\r\n height: 230,\r\n zIndex: 100,\r\n touchEnabled: true\r\n });\r\n \r\n item.addEventListener('click', function(e){\r\n //This never gets hit - event isn't getting called\r\n Ti.API.info('HELLOOO');\r\n });\r\n \r\n item.add(icon);\r\n item.add(label);\r\n dashboardItems.push(item); \r\n \r\n //Goofy stuff i have to do to make custom Dashboard Items show properly on the iPad in landscape mode\r\n if((i+1) % 3 == 0) { \r\n if( i % 8 == 0) { t=0; Ti.API.info('Top: '+t); continue;}\r\n t+=125; \r\n Ti.API.info('Top: '+t);\r\n Ti.API.info('Mod: '+ i%3);\r\n }\r\n\r\n // Debug Info for the DashboardItem positioning\r\n Ti.API.info('Top: '+t);\r\n Ti.API.info('Mod: '+ i%3);\r\n}\r\n\r\nvar dashboard = Ti.UI.createDashboardView({\r\n title: 'dashboard',\r\n data: dashboardItems,\r\n touchEnabled: true,\r\n wobble: false,\r\n height: 768,\r\n width: 900,\r\n top: 10\r\n});\r\n\r\nwin.add(background);\r\nwin.add(dashboard);\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-09-04T11:17:03.000+0000", "updated": "2012-09-04T11:17:23.000+0000" }, { "id": "418679", "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-02T20:12:18.000+0000", "updated": "2017-05-02T20:12:18.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }