ron
10/31/2017, 8:36 PMron
10/31/2017, 8:42 PMron
10/31/2017, 8:42 PMedvin
10/31/2017, 8:44 PMupdateModel
accepts a JsonObject
and updates the properties of the model. update
accepts another JsonModel
and copies it's properties, by first converting to json and then calling updateModel
.carlw
10/31/2017, 8:54 PMGreg Stepniewski
10/31/2017, 8:58 PMedvin
10/31/2017, 9:31 PMvalueFactory.valueProperty
, but our spinner
builders allow you to just pass the property
parameter and it will be automatically bound.Greg Stepniewski
10/31/2017, 9:35 PMpike
11/01/2017, 1:41 AMcarlw
11/01/2017, 2:39 AMpike
11/01/2017, 2:50 AManidotnet
11/01/2017, 6:26 AMron
11/01/2017, 9:12 AMron
11/01/2017, 9:12 AMron
11/01/2017, 9:26 AMclass SearchView : View() {
override val root = form {
val model = ViewModel()
val moviename = model.bind { SimpleStringProperty()}
val actorname = model.bind { SimpleStringProperty() }
val year = model.bind{ SimpleIntegerProperty() }
fieldset("search") {
field("movie") { textfield(moviename).enableWhen(actorname.value.isEmpty()) }
field("actor") { textfield(actorname) }
field("year") { textfield(year) }
}
}
}
ron
11/01/2017, 9:27 AMron
11/01/2017, 9:28 AMenableWhen (actorname.isNotDirty)
but it does not want to compile either wayron
11/01/2017, 9:29 AMedvin
11/01/2017, 9:42 AMedvin
11/01/2017, 9:42 AMron
11/01/2017, 9:46 AMenableWhen
seems to be the way to go and to hook it up to the actorname.isNotDirty
feels like a natural thingedvin
11/01/2017, 9:47 AMenableWhen
expects a boolean observable, not a boolean value.ron
11/01/2017, 9:48 AMedvin
11/01/2017, 9:48 AMedvin
11/01/2017, 9:48 AMedvin
11/01/2017, 9:49 AMron
11/01/2017, 9:53 AMron
11/01/2017, 9:54 AMfield("movie") { textfield(moviename).enableWhen(actorname.booleanBinding { it?.isBlank() ?: true }) }
edvin
11/01/2017, 10:01 AMisBlank
and isNotBlank
property, so the code would be enableWhen(actorname.isBlank())
for example.