     (filter (comp input-ids :id meta)
             (widget-seq view))))
 
+(defn- buttons [view]
+  (let [action-ids (into #{} action-ids)]
+    (filter (comp action-ids :action meta)
+            (widget-seq view))))
+
 (defmulti set-value {:private true} (fn [input value] 
                                       [(type input) (type value)]))
 

(defmethod set-value :default [input value]
  (println (format "set-value{%s value: %s}" (type input) value)))

(defn- update-inputs [view values]
  (doseq [input (inputs view)]
    (let [input-id (:id (meta input))
          value    (input-id values)]

  view)

(defn render [view model]
  (update-inputs view model))

(defn lock [view model]
  (doseq [{widget :widget} (widget-seq view)]
    (.setEnabled widget false))
  view)

(defn- unlock-buttons [view model]
  (let [{:keys [enabled-actions]} model
        buttons (filter (comp enabled-actions :action meta) (buttons view))]
    (doseq [{widget :widget} buttons]
      (.setEnabled widget true))
    view))

(defn- unlock-inputs [view model]
  (doseq [{widget :widget} (mapcat widget-seq (inputs view))]
    (.setEnabled widget true))
  view)

(defn unlock [view model]
  (-> view
      (unlock-buttons model)
      (unlock-inputs model)))

