edvin
11/30/2017, 8:24 PMfavetelinguis
11/30/2017, 8:24 PMamanda.hinchman-dominguez
11/30/2017, 8:25 PMamanda.hinchman-dominguez
11/30/2017, 8:26 PMedvin
11/30/2017, 8:26 PMamanda.hinchman-dominguez
11/30/2017, 8:26 PMedvin
11/30/2017, 8:26 PMamanda.hinchman-dominguez
11/30/2017, 8:27 PMedvin
11/30/2017, 8:27 PMcache
block there. Remember to add it 🙂amanda.hinchman-dominguez
11/30/2017, 8:27 PMedvin
11/30/2017, 8:28 PMamanda.hinchman-dominguez
11/30/2017, 8:29 PMedvin
11/30/2017, 8:29 PMamanda.hinchman-dominguez
11/30/2017, 8:29 PMedvin
11/30/2017, 8:29 PMedvin
11/30/2017, 8:34 PMinit
in your MetroTileHomepage
you're grabbing stuff off of workbenchController.metroTile
to create your grid. This code will NEVER run again, but I think you expect it to 🙂edvin
11/30/2017, 8:34 PMinit
only runs when the instance is created. A View is only ever created once in a given scope.edvin
11/30/2017, 8:36 PMMetroTileHomepage
a Fragment
instead of a View
and then remove the inject line from WorkbenchController
(Kill this: private val metroTileHomepage: MetroTileHomepage by inject()
)favetelinguis
11/30/2017, 8:36 PMenableWhen(user.token.isBlank())
is not compiling, why should there be a isBlank() on a Property<String>?edvin
11/30/2017, 8:36 PMMetroTileHomepage
when you need it: workbench.replaceWith(find<MetroTileHomepage>(), null, sizeToScene = true)
edvin
11/30/2017, 8:37 PMStringProperty
, which has this handy thing 🙂 Sorry, forgot to mention that 🙂amanda.hinchman-dominguez
11/30/2017, 8:38 PMedvin
11/30/2017, 8:38 PMProperty<String>
, you can create an observable value like this: boringPropertyOfString.booleanBinding { it?.isBlank() ?: true }
amanda.hinchman-dominguez
11/30/2017, 8:39 PMfavetelinguis
11/30/2017, 8:40 PMclass User: JsonModel {
val tokenProperty = SimpleStringProperty("")
var token by tokenProperty
override fun updateModel(json: JsonObject) {
with(json) {
token = string("token")
//error = string("error")
}
}
}
class UserModel : tornadofx.ItemViewModel<User>() {
val token = bind(User::tokenProperty)
}
edvin
11/30/2017, 8:40 PMStringProperty
when you need access to those functions: val token: StringProperty = bind(User::tokenProperty)
favetelinguis
11/30/2017, 8:42 PMboringPropertyOfString.booleanBinding { it?.isBlank() ?: true }
is the way to go?edvin
11/30/2017, 8:43 PMedvin
11/30/2017, 8:44 PMisBlank()
function even on Property<String>
. I added it a little while back because @ron needed it 🙂edvin
11/30/2017, 8:44 PM