https://kotlinlang.org logo
#tornadofx
Title
# tornadofx
a

albrechtroehm

11/07/2019, 4:03 PM
Hello everyone, I have a controller which stores the data of some workers types. At some point i need this controller to calculate the hourlyRate and I would like to inject this controller. This seems not to be possible because my class is not a tfx component so i used
val workers = find(WorkerDatabase::class)
which works fine if i use it in a function, but not if i declare it as a field in the class (Getting NPE if i use
workers
). Maybe somebody could tell me whether i'm doing something wrong ...
You need to look at your control as it is declared
4 Views