This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-14
Channels
- # beginners (33)
- # cider (17)
- # clara (13)
- # cljs-dev (7)
- # clojars (1)
- # clojure (47)
- # clojure-brasil (1)
- # clojure-dev (4)
- # clojure-italy (3)
- # clojure-russia (4)
- # clojure-uk (1)
- # clojurescript (4)
- # core-async (4)
- # core-logic (6)
- # cursive (7)
- # datomic (1)
- # emacs (35)
- # fulcro (56)
- # hoplon (7)
- # jobs-discuss (89)
- # lumo (6)
- # numerical-computing (1)
- # onyx (86)
- # parinfer (3)
- # reagent (2)
- # rum (2)
- # specter (5)
- # sql (13)
- # unrepl (2)
When using [fulcro-css.css :refer [upsert-css]], why always alert “java.lang.IllegalAccessError: upsert-css does not exist”
The fulcro-css dependency is in your project.clj?https://clojars.org/fulcrologic/fulcro-css
:thinking_face:Need to put [fulcrologic/fulcro-css “2.0.0”] in project.clj ? Even if I added it to the project.clj, the alert still exist.
But when you changed the colocated-style => then trigger the rerender => then paused by the alert. I have to re-load the clj file to let (css/upsert-css “my-css” Root) work.
I am being slowly driven mad again by routing. What am I doing wrong in this example:
`(defsc Screen1 [this {:keys [screen1-datum dropdown]}] {:initial-state (fn [p] {:screen1-datum 42 :dropdown (b/dropdown :dropdown-screen1 "10" [(b/dropdown-item 10 "10") (b/dropdown-item 50 "50") (b/dropdown-item 100 "100")])}) :ident (fn [] [:screen1 :singleton]) :query (fn [] [:screen1-datum {:dropdown (prim/get-query b/Dropdown)}])} (dom/div nil (dom/h1 nil "Screen 1") (b/ui-dropdown dropdown :stateful? true))) (defsc Screen2 [this {:keys [screen2-datum dropdown]}] {:initial-state (fn [p] {:screen2-datum 99 :dropdown (b/dropdown :dropdown-screen2 "A" [(b/dropdown-item :a "A") (b/dropdown-item :b "B") (b/dropdown-item :c "C")])}) :ident (fn [] [:screen2 :singleton]) :query (fn [] [:screen2-datum {:dropdown (prim/get-query b/Dropdown)}])} (dom/div nil (dom/h1 nil "Screen 2") (b/ui-dropdown dropdown :stateful? true))) (defn select-router [props] #?(:cljs(js/console.log "props" props)) (condp #(contains? %2 %1) props :screen1-datum [:screen1 :singleton] :screen2-datum [:screen2 :singleton])) (defrouter ScreenRouter :screen-router (ident [this props] (select-router props)) :screen1 Screen1 :screen2 Screen2) (def ui-screen-router (prim/factory ScreenRouter)) (defsc Root [this {:keys [screens]}] {:initial-state (fn [p] (merge (r/routing-tree (r/make-route :show-screen1 [(r/router-instruction :screen-router [:screen1 :singleton])]) (r/make-route :show-screen2 [(r/router-instruction :screen-router [:screen2 :singleton])])) {:screens (prim/get-initial-state ScreenRouter nil)})) :query (fn [] [{:screens (prim/get-query ScreenRouter)}])} (let [showScreen (fn [screen] (prim/transact! this `[(r/route-to {:handler ~screen})]))] (dom/div nil (dom/div nil (b/button {:onClick #(showScreen :show-screen1)} "Show 1") (b/button {:onClick #(showScreen :show-screen2)} "Show 2")) (ui-screen-router screens))))`
The dropdown on Screen 2 does not work.
If I swap Screen1 and Screen2 in the router then Screen1 is broken.
The map :bootstrap.dropdown/by-id only contains :dropdown-screen1.
I am using Fulcro 2.1.0
@mandor2017 kind of a wide open question
The dropdown menu on Screen2 is showing only the caret.
2.1.0.
The map :bootstrap.dropdown/by-id only contains :dropdown-screen1
Yes. :screen2 :singleton looks correct.
dropdown has [:bootstrap.dropdown/by-id :dropdown-screen2]
But that is not present.
There is no loading. The example code is all there is.
Items for Screen one menu only.
Can you tried it to see if my setup is hosed in some fashion?
I was actually headed out the door. was trying to see if I could help you spot something.
[9303.326s] [fulcro.client] malformed Ident. An ident must be a vector of two elements (a keyword and an EDN value). Check the Ident implementation of component fulcro.ui.bootstrap3/Dropdown
.
console.js:203 [9303.328s] [fulcro.client] component fulcro.ui.bootstrap3/Dropdown's ident ([nil nil]) has a nil
second element. This warning can be safely ignored if that is intended.
2
:bootstrap.dropdown/by-id get a nil entry when I try the broken dropdown.
Both screen 1 and 2 use :dropdown and Root merges screen 1 and 2?
no. I was worried about the keywords possibly overlapping, but the merge is more complicated than that with unions
{:screen2-datum 99, :dropdown {:fulcro.ui.bootstrap3/id :dropdown-screen2, :fulcro.ui.bootstrap3/active-item nil, :fulcro.ui.bootstrap3/label "A", :fulcro.ui.bootstrap3/items [{:fulcro.ui.bootstrap3/id :a, :fulcro.ui.bootstrap3/label "A"} {:fulcro.ui.bootstrap3/id 😛, :fulcro.ui.bootstrap3/label "B"} {:fulcro.ui.bootstrap3/id :c, :fulcro.ui.bootstrap3/label "C"}], :fulcro.ui.bootstrap3/open? false, :type :bootstrap.dropdown/by-id}}
if that works, then it is a bug. If it doesn,t, then we're missing some minor typo or something
Then the problem screen switches.
At github?
Yes. you could also try naming :dropdown
differently in one...but that should not matter.
I will file a bug now. Thank you for your assistance.