I was going to do something along the lines of...
{:fx/type :text-field
:user-data {:roles [:search-field]}}
But trying to render the above results in: clojure.lang.ExceptionInfo: No such prop: :user-data {:prop :user-data}.
According to the JavaFX docs at https://openjfx.io/javadoc/20/javafx.graphics/javafx/scene/Node.html#setUserData(java.lang.Object) .getUserData and .setUserData are available on every Node and I could do a workaround with an fx/make-ext-with-props to add the prop on arbitrary node, but... I wonder if there's any specific reason :user-data isn't exposed as a prop on every node in cljfx?
Looking at the implementation of cljfx, it seems all that is required to support the prop on every node is to add :user-data [:setter lifecycle/scalar] to the map at https://github.com/cljfx/cljfx/blob/5f3737989ac1f57a5bf28c0070d1db12901a6d77/src/cljfx/fx/node.clj#L25C5-L25C42. @vlaaad Is my understanding correct here? Would you mind me submitting a PR for this?Hmm I don’t see any reason not to expose it. Please submit a PR!
Here it goes: https://github.com/cljfx/cljfx/pull/176 It's a tiny change and I'm not sure if anything else is needed to merge it. Please let me know if you'd like me to account for anything I could've missed...
Cool thanks, I released 1.7.24 with your changes!
Thank you heaps 🎉