Comments (8)
MultiFn
s should be able to be fx-types too (they are not fn?
s)
from cljfx.
There is a performance penalty for using protocols instead of cond
, also it's not that great with cljfx concept of this stuff being configurable per renderer
from cljfx.
Just an anecdote after having just been bitten by this.
I have a TableView
that receives a list of maps as it's :items
property. The TableColumn
s :cell-value-factory
property received the keyword :label
to pull the 'label' value out of the row map. It died with the below (pretty) obscure message and gigantic callstack:
clojure.lang.ExceptionInfo: Don't know how to coerce {:target javafx.util.Callback, :x :label}
at cljfx.coerce$fail.invokeStatic(coerce.clj:43)
at cljfx.coerce$fail.invoke(coerce.clj:42)
at cljfx.fx.table_column$table_cell_value_factory.invokeStatic(table_column.clj:21)
at cljfx.fx.table_column$table_cell_value_factory.invoke(table_column.clj:14)
at cljfx.mutator$setter$fn__18647.invoke(mutator.clj:28)
at cljfx.mutator$eval18576$fn__18621$G__18563__18632.invoke(mutator.clj:13)
at cljfx.prop$assign_BANG_.invokeStatic(prop.clj:36)
at cljfx.prop$assign_BANG_.invoke(prop.clj:34)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:39)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:280)
at clojure.core$update.invokeStatic(core.clj:6196)
at clojure.core$update.invoke(core.clj:6188)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
at clojure.core$reduce.invokeStatic(core.clj:6827)
at clojure.core$reduce.invoke(core.clj:6810)
at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_extra_props$fn__18953.invoke(lifecycle.clj:348)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:279)
at clojure.core$update.invokeStatic(core.clj:6196)
at clojure.core$update.invoke(core.clj:6188)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
at clojure.core$reduce.invokeStatic(core.clj:6827)
at clojure.core$reduce.invoke(core.clj:6810)
at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_dynamic_fn$fn__18833.invoke(lifecycle.clj:76)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:280)
at clojure.core$update.invokeStatic(core.clj:6196)
at clojure.core$update.invoke(core.clj:6188)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
at clojure.core$reduce.invokeStatic(core.clj:6827)
at clojure.core$reduce.invoke(core.clj:6810)
at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_extra_props$fn__18953.invoke(lifecycle.clj:348)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:279)
at clojure.core$update.invokeStatic(core.clj:6196)
at clojure.core$update.invoke(core.clj:6188)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
at clojure.core$reduce.invokeStatic(core.clj:6827)
at clojure.core$reduce.invoke(core.clj:6810)
at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_dynamic_fn$fn__18833.invoke(lifecycle.clj:76)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:280)
at clojure.core$update.invokeStatic(core.clj:6196)
at clojure.core$update.invoke(core.clj:6188)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
at clojure.core$reduce.invokeStatic(core.clj:6827)
at clojure.core$reduce.invoke(core.clj:6810)
at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_dynamic_fn$fn__18833.invoke(lifecycle.clj:76)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$wrap_extra_props$fn__18953.invoke(lifecycle.clj:348)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:279)
at clojure.core$update.invokeStatic(core.clj:6196)
at clojure.core$update.invoke(core.clj:6188)
at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
at clojure.core$reduce.invokeStatic(core.clj:6827)
at clojure.core$reduce.invoke(core.clj:6810)
at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
at clojure.core$fn__8437.invokeStatic(core.clj:6845)
at clojure.core$fn__8437.invoke(core.clj:6830)
at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
at clojure.core$reduce_kv.invoke(core.clj:6847)
at cljfx.composite$create_props.invokeStatic(composite.clj:17)
at cljfx.composite$create_props.invoke(composite.clj:16)
at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
at cljfx.composite$create_composite_component.invoke(composite.clj:26)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$wrap_on_delete$fn__19030.invoke(lifecycle.clj:435)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
at cljfx.lifecycle$fn__18823.invokeStatic(lifecycle.clj:58)
at cljfx.lifecycle$fn__18823.invoke(lifecycle.clj:56)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.lifecycle$wrap_map_desc$fn__19037.invoke(lifecycle.clj:446)
at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
at cljfx.renderer$render_component.invokeStatic(renderer.clj:57)
at cljfx.renderer$render_component.invoke(renderer.clj:47)
at cljfx.renderer$create$fn__19371.invoke(renderer.clj:77)
at cljfx.renderer$perform_render$fn__19322.invoke(renderer.clj:23)
at cljfx.renderer$perform_render.invokeStatic(renderer.clj:22)
at cljfx.renderer$perform_render.invoke(renderer.clj:14)
at cljfx.renderer$request_render$fn__19348$fn__19352.invoke(renderer.clj:44)
at cljfx.renderer$request_render$fn__19348.invoke(renderer.clj:44)
at clojure.lang.AFn.run(AFn.java:22)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
at java.base/java.lang.Thread.run(Thread.java:834)
I'm enjoying cljfx
so far but I'm having to do a lot of web searches and trial and error to figure some basic things out. I'm coming from seesaw
so I'm fairly spoilt regarding documentation and examples.
from cljfx.
Hi @torkus! I don't remember why it's like that, but you need to supply a function created by fn
, not a keyword, like that:
(defn get-label [m]
(:label m))
I think it's unnecessary, I'll try to figure out why it is like that and see if it can be fixed. By the way, it has nothing to do with lifecycles :)
from cljfx.
Created an issue: #87
from cljfx.
yeah, sorry, wasn't sure and was hesitant to create a new ticket. It was a weird bit of cognitive dissonance to wrap a keyword in a function: https://github.com/ogri-la/strongbox/pull/180/files#diff-6239587cc2f3fc5395df70d4339ffc15R158-R161
from cljfx.
It's fine, issues are a good place to ask questions.
from cljfx.
Agree about wrapping keyword in a function
from cljfx.
Related Issues (20)
- Spinner Example
- controlsfx, CheckComboBox HOT 7
- depstar is deprecated and archived; switch to tools.build HOT 2
- The example project fails with (UnsupportedOperationException) HOT 6
- Mouseclick and textfield ?
- Support for CheckBoxTreeItem/CheckBoxTreeCell
- Method for adding another context-like property HOT 1
- Runnning examples/e20_markdown_editor results in NullPointerException: HOT 1
- How do I use StyledTextArea or any new class? HOT 2
- Broken encoding for Sanskrit text in WebView HOT 2
- How do I exit the packaged app on window close or menu quit command HOT 2
- Unable to open DISPLAY HOT 4
- Trying to understand the lifecycle again
- Using cljfx with Gradle HOT 2
- Problem using leiningen HOT 2
- how to pass args to constructors HOT 3
- how to set the background of a region HOT 5
- Children: duplicate children added: when using pie-chart and dynamic rendering HOT 3
- Memory reuse with `fx/ext-instance-factory` HOT 5
- behavior of tree cell factory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cljfx.