edvin / tornadofx-guide

TornadoFX Guide
133 stars 67 forks source link

Fix declaration of age variable in person #103

Closed IEnoobong closed 5 years ago

IEnoobong commented 5 years ago

Age was previously Int but it can't be binded to column, changed to SimpleIntegerProperty to allow for binding

I need help with the new screenshot please

edvin commented 5 years ago

You can still bind a non observable value, so this doesn't need to change. You could however make an integerBinding based on the birthday property, so that changes to the birthday would auotmatically reflect in the tableview. However, birthdays don't change so often, so I'd say it's wasteful to create a property for this readonly field :)

IEnoobong commented 5 years ago

@edvin but trying to as int gives this error Screenshot from 2019-03-18 08-54-11

IntelliJ 2018.3 TornadoFx 1.7.18

edvin commented 5 years ago

You must use readonlyColumn()

IEnoobong commented 5 years ago

I see, then I'll change the PR to use readonlyColumn there then

edvin commented 5 years ago

Perfect, thanks :) This syntax used to be valid, but we had to rename the column builders for non observables due to type shadowing issues.