{ "id": "127869", "key": "ALOY-971", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2015-01-14T22:06:31.000+0000", "created": "2014-03-19T17:17:05.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "community" ], "versions": [ { "id": "15759", "description": "Alloy 1.3.1", "name": "Alloy 1.3.1", "archived": false, "released": true, "releaseDate": "2014-02-10" } ], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-01-14T22:06:31.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": [], "description": "Using TI SDK GA 3.2.2 and iPhone Simulator...\r\n\r\nI've bound a listener to \"my event\" on Alloy.Collections.instance('TestModel2'). When I call trigger('my event') once on the collection singleton the listener is fired twice.\r\n\r\nSee attached project file. Just build and run in the iPhone simulator to see the issue duplicated. You should see an alert fired twice when you click \"Hello World\"", "attachment": [ { "id": "46736", "filename": "alloy_binding_test.zip", "author": { "name": "noahlively", "key": "noahlively", "displayName": "Noah Lively", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-19T17:17:05.000+0000", "size": 5916660, "mimeType": "application/zip" } ], "flagged": false, "summary": "Alloy : Collection events triggered with trigger() method are firing twice", "creator": { "name": "noahlively", "key": "noahlively", "displayName": "Noah Lively", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "noahlively", "key": "noahlively", "displayName": "Noah Lively", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "297914", "author": { "name": "noahlively", "key": "noahlively", "displayName": "Noah Lively", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Looks like backbone splits my event on the space and considers \"my\" end \"event\" two separate events... When I change to \"my_event\" it works the way I wanted it to.\r\n\r\nI'm used to Titanium.Api.fireEvent() and Titanium.Api.addEventListener() accepting event names with spaces. Perhaps it should be added to the Alloy docs that backbone splits events on space.", "updateAuthor": { "name": "noahlively", "key": "noahlively", "displayName": "Noah Lively", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-19T17:25:39.000+0000", "updated": "2014-03-19T17:32:22.000+0000" }, { "id": "298217", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "As stated on http://docs.appcelerator.com/backbone/0.9.2/#Events-on \"The event string may also be a space-delimited list of several events...\" So you're right that Backbone (which underlies Alloy models/collections) is treating your \"my event\" as two events. Honestly, until seeing this ticket, it never occurred to me to name events with spaces. I'm surprised to learn that it actually works with Titanium events (in both Classic and Alloy styles). We'll investigate to see if this is something we can support without breaking existing apps that use space-delimited events currently.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-03-21T14:04:17.000+0000", "updated": "2014-03-21T14:04:17.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }