You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
Now, in my main View (in the init block), I can't access the JSON object with this code:
val obj = app.config.jsonObject("test")
println(obj?.string("greeting"))
I got null for obj!
What's seem strange is that the following code works (I use similar code from the extension function fun Properties.jsonObject(key: String) from Configurable inferface code):
This was actually due to a framework bug. I have committed a fix for it now. The extension function defined inside Component on Properties.jsonObject actually looked up the value in the View's config file instead of the app config file. Thanks for reporting this :)
You can work around it like you did until the next release, unless you want to run against a snapshot. I have built a snapshot and published it to the sonatype repo just in case :)
I a simple TornadoFX app I defined a configuration file,
app.properties
, with this content:And in my App class I'm able to read the JSON object like this without problem:
Now, in my main View (in the init block), I can't access the JSON object with this code:
I got null for
obj
!What's seem strange is that the following code works (I use similar code from the extension function
fun Properties.jsonObject(key: String)
fromConfigurable
inferface code):What's going on?
Thanks!
Bertrand
The text was updated successfully, but these errors were encountered: