{"action":"created","comment":{"url":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/comments/28351948","id":28351948,"diff_hunk":"@@ -434,12 +443,37 @@\n                          registeredComponentName eventName)\n                        #f))))\n \n+       ;; For the HandlesEventDispatching interface\n+       (define (dispatchMultiEvent eventName :: java.lang.String","path":"appinventor/buildserver/src/com/google/appinventor/buildserver/resources/runtime.scm","position":28,"original_position":28,"commit_id":"52987a9646e052530f9be7d96067fb01888c4b3b","original_commit_id":"52987a9646e052530f9be7d96067fb01888c4b3b","user":{"login":"mark-friedman","id":1743690,"avatar_url":"https://avatars.githubusercontent.com/u/1743690?v=3","gravatar_id":"","url":"https://api.github.com/users/mark-friedman","html_url":"https://github.com/mark-friedman","followers_url":"https://api.github.com/users/mark-friedman/followers","following_url":"https://api.github.com/users/mark-friedman/following{/other_user}","gists_url":"https://api.github.com/users/mark-friedman/gists{/gist_id}","starred_url":"https://api.github.com/users/mark-friedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mark-friedman/subscriptions","organizations_url":"https://api.github.com/users/mark-friedman/orgs","repos_url":"https://api.github.com/users/mark-friedman/repos","events_url":"https://api.github.com/users/mark-friedman/events{/privacy}","received_events_url":"https://api.github.com/users/mark-friedman/received_events","type":"User","site_admin":false},"body":"@puravidaapps and @gitars \r\n\r\nIt's also useful even without dynamically created components.  For example, the expression in the \"for component\" socket doesn't have to just be a constant (e.g. \"Button1\");  it could be a variable, procedure call, etc.","created_at":"2015-04-14T17:55:34Z","updated_at":"2015-04-14T17:55:34Z","html_url":"https://github.com/mit-cml/appinventor-sources/pull/347#discussion_r28351948","pull_request_url":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/347","_links":{"self":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/comments/28351948"},"html":{"href":"https://github.com/mit-cml/appinventor-sources/pull/347#discussion_r28351948"},"pull_request":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/347"}}},"pull_request":{"url":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/347","id":32561699,"html_url":"https://github.com/mit-cml/appinventor-sources/pull/347","diff_url":"https://github.com/mit-cml/appinventor-sources/pull/347.diff","patch_url":"https://github.com/mit-cml/appinventor-sources/pull/347.patch","issue_url":"https://api.github.com/repos/mit-cml/appinventor-sources/issues/347","number":347,"state":"open","locked":false,"title":"Added multi/generic event handlers","user":{"login":"gitars","id":4552296,"avatar_url":"https://avatars.githubusercontent.com/u/4552296?v=3","gravatar_id":"","url":"https://api.github.com/users/gitars","html_url":"https://github.com/gitars","followers_url":"https://api.github.com/users/gitars/followers","following_url":"https://api.github.com/users/gitars/following{/other_user}","gists_url":"https://api.github.com/users/gitars/gists{/gist_id}","starred_url":"https://api.github.com/users/gitars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitars/subscriptions","organizations_url":"https://api.github.com/users/gitars/orgs","repos_url":"https://api.github.com/users/gitars/repos","events_url":"https://api.github.com/users/gitars/events{/privacy}","received_events_url":"https://api.github.com/users/gitars/received_events","type":"User","site_admin":false},"body":"Stemming off of stuff from here:\r\nhttps://github.com/mit-cml/appinventor-sources/pull/313\r\n\r\nThis is a solution to this problem that works like this (copied from other pull request thread):\r\nBasically, we still have the \"multi-generic\" event handler that returns a the component when it is called, but we register it as a normal event to one of the components on the screen, under a different name such as \"MultiGeneric-\" + EventName. Then, when a normal event occurs, we check all the components to see if any of them have a event closure for \"MultiGeneric-\" + EventName. Then, we simply add the component that triggered the event to the list of arguments and dispatch it.\r\n\r\nExample. A screen with three buttons, and this block. All of the blocks will have their text changed on click.\r\n\r\n![screen shot 2015-04-02 at 8 10 31 pm](https://cloud.githubusercontent.com/assets/4552296/6976195/20773086-d974-11e4-88eb-b9cd063e5b76.png)\r\n\r\n","created_at":"2015-04-03T00:09:40Z","updated_at":"2015-04-14T17:55:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2f872f8b2b5c56fa58fd41d0a60cd9959c3c31f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/347/commits","review_comments_url":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/347/comments","review_comment_url":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mit-cml/appinventor-sources/issues/347/comments","statuses_url":"https://api.github.com/repos/mit-cml/appinventor-sources/statuses/52987a9646e052530f9be7d96067fb01888c4b3b","head":{"label":"gitars:generic-events","ref":"generic-events","sha":"52987a9646e052530f9be7d96067fb01888c4b3b","user":{"login":"gitars","id":4552296,"avatar_url":"https://avatars.githubusercontent.com/u/4552296?v=3","gravatar_id":"","url":"https://api.github.com/users/gitars","html_url":"https://github.com/gitars","followers_url":"https://api.github.com/users/gitars/followers","following_url":"https://api.github.com/users/gitars/following{/other_user}","gists_url":"https://api.github.com/users/gitars/gists{/gist_id}","starred_url":"https://api.github.com/users/gitars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitars/subscriptions","organizations_url":"https://api.github.com/users/gitars/orgs","repos_url":"https://api.github.com/users/gitars/repos","events_url":"https://api.github.com/users/gitars/events{/privacy}","received_events_url":"https://api.github.com/users/gitars/received_events","type":"User","site_admin":false},"repo":{"id":30127832,"name":"appinventor-sources","full_name":"gitars/appinventor-sources","owner":{"login":"gitars","id":4552296,"avatar_url":"https://avatars.githubusercontent.com/u/4552296?v=3","gravatar_id":"","url":"https://api.github.com/users/gitars","html_url":"https://github.com/gitars","followers_url":"https://api.github.com/users/gitars/followers","following_url":"https://api.github.com/users/gitars/following{/other_user}","gists_url":"https://api.github.com/users/gitars/gists{/gist_id}","starred_url":"https://api.github.com/users/gitars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitars/subscriptions","organizations_url":"https://api.github.com/users/gitars/orgs","repos_url":"https://api.github.com/users/gitars/repos","events_url":"https://api.github.com/users/gitars/events{/privacy}","received_events_url":"https://api.github.com/users/gitars/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gitars/appinventor-sources","description":"MIT App Inventor Public Open Source","fork":true,"url":"https://api.github.com/repos/gitars/appinventor-sources","forks_url":"https://api.github.com/repos/gitars/appinventor-sources/forks","keys_url":"https://api.github.com/repos/gitars/appinventor-sources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitars/appinventor-sources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitars/appinventor-sources/teams","hooks_url":"https://api.github.com/repos/gitars/appinventor-sources/hooks","issue_events_url":"https://api.github.com/repos/gitars/appinventor-sources/issues/events{/number}","events_url":"https://api.github.com/repos/gitars/appinventor-sources/events","assignees_url":"https://api.github.com/repos/gitars/appinventor-sources/assignees{/user}","branches_url":"https://api.github.com/repos/gitars/appinventor-sources/branches{/branch}","tags_url":"https://api.github.com/repos/gitars/appinventor-sources/tags","blobs_url":"https://api.github.com/repos/gitars/appinventor-sources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitars/appinventor-sources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitars/appinventor-sources/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitars/appinventor-sources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitars/appinventor-sources/statuses/{sha}","languages_url":"https://api.github.com/repos/gitars/appinventor-sources/languages","stargazers_url":"https://api.github.com/repos/gitars/appinventor-sources/stargazers","contributors_url":"https://api.github.com/repos/gitars/appinventor-sources/contributors","subscribers_url":"https://api.github.com/repos/gitars/appinventor-sources/subscribers","subscription_url":"https://api.github.com/repos/gitars/appinventor-sources/subscription","commits_url":"https://api.github.com/repos/gitars/appinventor-sources/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitars/appinventor-sources/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitars/appinventor-sources/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitars/appinventor-sources/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitars/appinventor-sources/contents/{+path}","compare_url":"https://api.github.com/repos/gitars/appinventor-sources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitars/appinventor-sources/merges","archive_url":"https://api.github.com/repos/gitars/appinventor-sources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitars/appinventor-sources/downloads","issues_url":"https://api.github.com/repos/gitars/appinventor-sources/issues{/number}","pulls_url":"https://api.github.com/repos/gitars/appinventor-sources/pulls{/number}","milestones_url":"https://api.github.com/repos/gitars/appinventor-sources/milestones{/number}","notifications_url":"https://api.github.com/repos/gitars/appinventor-sources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitars/appinventor-sources/labels{/name}","releases_url":"https://api.github.com/repos/gitars/appinventor-sources/releases{/id}","created_at":"2015-01-31T21:58:50Z","updated_at":"2015-03-25T22:03:33Z","pushed_at":"2015-04-08T03:08:54Z","git_url":"git://github.com/gitars/appinventor-sources.git","ssh_url":"git@github.com:gitars/appinventor-sources.git","clone_url":"https://github.com/gitars/appinventor-sources.git","svn_url":"https://github.com/gitars/appinventor-sources","homepage":"http://appinventor.mit.edu/appinventor-sources/","size":314380,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mit-cml:master","ref":"master","sha":"b246f0e09a41788b7931d6b2a5df46043481ca11","user":{"login":"mit-cml","id":1742866,"avatar_url":"https://avatars.githubusercontent.com/u/1742866?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-cml","html_url":"https://github.com/mit-cml","followers_url":"https://api.github.com/users/mit-cml/followers","following_url":"https://api.github.com/users/mit-cml/following{/other_user}","gists_url":"https://api.github.com/users/mit-cml/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-cml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-cml/subscriptions","organizations_url":"https://api.github.com/users/mit-cml/orgs","repos_url":"https://api.github.com/users/mit-cml/repos","events_url":"https://api.github.com/users/mit-cml/events{/privacy}","received_events_url":"https://api.github.com/users/mit-cml/received_events","type":"Organization","site_admin":false},"repo":{"id":4787136,"name":"appinventor-sources","full_name":"mit-cml/appinventor-sources","owner":{"login":"mit-cml","id":1742866,"avatar_url":"https://avatars.githubusercontent.com/u/1742866?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-cml","html_url":"https://github.com/mit-cml","followers_url":"https://api.github.com/users/mit-cml/followers","following_url":"https://api.github.com/users/mit-cml/following{/other_user}","gists_url":"https://api.github.com/users/mit-cml/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-cml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-cml/subscriptions","organizations_url":"https://api.github.com/users/mit-cml/orgs","repos_url":"https://api.github.com/users/mit-cml/repos","events_url":"https://api.github.com/users/mit-cml/events{/privacy}","received_events_url":"https://api.github.com/users/mit-cml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mit-cml/appinventor-sources","description":"MIT App Inventor Public Open Source","fork":false,"url":"https://api.github.com/repos/mit-cml/appinventor-sources","forks_url":"https://api.github.com/repos/mit-cml/appinventor-sources/forks","keys_url":"https://api.github.com/repos/mit-cml/appinventor-sources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mit-cml/appinventor-sources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mit-cml/appinventor-sources/teams","hooks_url":"https://api.github.com/repos/mit-cml/appinventor-sources/hooks","issue_events_url":"https://api.github.com/repos/mit-cml/appinventor-sources/issues/events{/number}","events_url":"https://api.github.com/repos/mit-cml/appinventor-sources/events","assignees_url":"https://api.github.com/repos/mit-cml/appinventor-sources/assignees{/user}","branches_url":"https://api.github.com/repos/mit-cml/appinventor-sources/branches{/branch}","tags_url":"https://api.github.com/repos/mit-cml/appinventor-sources/tags","blobs_url":"https://api.github.com/repos/mit-cml/appinventor-sources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mit-cml/appinventor-sources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mit-cml/appinventor-sources/git/refs{/sha}","trees_url":"https://api.github.com/repos/mit-cml/appinventor-sources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mit-cml/appinventor-sources/statuses/{sha}","languages_url":"https://api.github.com/repos/mit-cml/appinventor-sources/languages","stargazers_url":"https://api.github.com/repos/mit-cml/appinventor-sources/stargazers","contributors_url":"https://api.github.com/repos/mit-cml/appinventor-sources/contributors","subscribers_url":"https://api.github.com/repos/mit-cml/appinventor-sources/subscribers","subscription_url":"https://api.github.com/repos/mit-cml/appinventor-sources/subscription","commits_url":"https://api.github.com/repos/mit-cml/appinventor-sources/commits{/sha}","git_commits_url":"https://api.github.com/repos/mit-cml/appinventor-sources/git/commits{/sha}","comments_url":"https://api.github.com/repos/mit-cml/appinventor-sources/comments{/number}","issue_comment_url":"https://api.github.com/repos/mit-cml/appinventor-sources/issues/comments{/number}","contents_url":"https://api.github.com/repos/mit-cml/appinventor-sources/contents/{+path}","compare_url":"https://api.github.com/repos/mit-cml/appinventor-sources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mit-cml/appinventor-sources/merges","archive_url":"https://api.github.com/repos/mit-cml/appinventor-sources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mit-cml/appinventor-sources/downloads","issues_url":"https://api.github.com/repos/mit-cml/appinventor-sources/issues{/number}","pulls_url":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls{/number}","milestones_url":"https://api.github.com/repos/mit-cml/appinventor-sources/milestones{/number}","notifications_url":"https://api.github.com/repos/mit-cml/appinventor-sources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mit-cml/appinventor-sources/labels{/name}","releases_url":"https://api.github.com/repos/mit-cml/appinventor-sources/releases{/id}","created_at":"2012-06-25T20:42:28Z","updated_at":"2015-04-14T13:42:20Z","pushed_at":"2015-04-13T19:00:32Z","git_url":"git://github.com/mit-cml/appinventor-sources.git","ssh_url":"git@github.com:mit-cml/appinventor-sources.git","clone_url":"https://github.com/mit-cml/appinventor-sources.git","svn_url":"https://github.com/mit-cml/appinventor-sources","homepage":"http://appinventor.mit.edu/appinventor-sources/","size":505421,"stargazers_count":155,"watchers_count":155,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":410,"mirror_url":null,"open_issues_count":76,"forks":410,"open_issues":76,"watchers":155,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/347"},"html":{"href":"https://github.com/mit-cml/appinventor-sources/pull/347"},"issue":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/issues/347"},"comments":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/issues/347/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/347/comments"},"review_comment":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/pulls/347/commits"},"statuses":{"href":"https://api.github.com/repos/mit-cml/appinventor-sources/statuses/52987a9646e052530f9be7d96067fb01888c4b3b"}}}}