           [:td {:style {:width "40%"}}
            (om/build dropdown {:default role
                                :items projects-table-roles}
-                    {:opts {:dropdown-chan dropdown-chan
+                    {:opts {:event-chan event-chan
                             :id (str project_id "-role")
                             :path [:projects project_id]}})]])))))
 
 
-(defn projects-table [{:keys [projects existing-selections]} owner {:keys [dropdown-chan]}]
+(defn projects-table [{:keys [projects existing-selections]} owner {:keys [event-chan]}]
   (reify
     om/IRender
     (render [_]

         [:div.col-md-12 {:style {:padding-top "10px"}}
          (if editing
            [:div
             ;; Username
             [:div
              [:div.col-md-4
               (om/build (username-selection-form data) (:user data))]
              (when (seq username)
                [:button.btn.btn-primary {:on-click #(post-form data username @selected)} "Save"])]
             ;; Alert
             [:div {:style {:padding-top "10px"}} (om/build bs/alert (:alert data))]
             ;; Admin Role - only visible to super admins
             (when (and (= "super-admin" (:role editor)) (not (nil? role)))
               [:div.form-group.col-md-6
                [:label.control-label.col-md-2 {:for "role-selection"} "Role:"]
                [:div.col-md-6
                 [:div {:style {:width "100%"}}
                  (om/build dropdown {:default role
                                      :items user-roles}
                            {:opts {:dropdown-chan dropdown-chan
                                    :id "role-selection"
                                    :path [:role]}})]]])

             ;; Programmes
             [:div.col-md-12 {:style {:padding-top "15px"}}
              [:h4 "All Programmes"]
              (om/build programmes-table {:programmes (-> data :programmes :data)
                                          :existing-selections (-> data :user :programmes)}
                        {:opts {:dropdown-chan dropdown-chan}})]
             ;; Projects
             [:div.col-md-12
              [:h4 "All Projects"]
              (om/build projects-table {:projects (-> data :projects :data)
                                        :existing-selections (-> data :user :projects)}
                        {:opts {:dropdown-chan dropdown-chan}})]]

            [:div.col-md-12
             [:div.col-md-12 [:div.alert.alert-success {:role "alert"} "User updated successfully."]

         [:tbody
          (om/build-all programmes-row
                        (sort-by :name (mapv #(assoc % :role (get-in existing-selections [(:programme_id %)] "none"))
                                             programmes)) {:key :programme_id :opts {:event-chan event-chan}})]]]))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Entire view of the page
