I use clojure and hiccup (with noir) and I have this code:
(defn dataframe [id] (db/db-to-data id)) (defpartial drop-downs [nms] (for [nm (keys nms)] (drop-down nm (get nms nm))[:br]) (submit-button "Refresh") ) (defpage "/dataset/table/:id" {:keys [id]} (common/layout (form-to [:post (format "/dataset/table/%s" id)] (drop-downs {"alessio" [:col0], "test" [:col1]}) ) (html-table (dataframe id))))
My problem is related to:
(for [nm (keys nms)] (drop-down nm (get nms nm))[:br])
I want to have several options in my form. The line above does this, but for some reason it does not consider [: br], so it does not break the line. However, if I do this:
(form-to [:post (format "/dataset/table/%s" id)] (drop-down "Test1" "1")[:br] (drop-down "Test2" "2")[:br] )
The [: br] tag works. I believe that this is due to how the macro works (for), but I could not understand the reason and how to fix it.
EDIT
As advised, I refused to use. The final result is below (this is Joost's answer with a little mod):
(mapcat
source share