Binding.scala
Binding.scala copied to clipboard
Generic javafx controls don't work
E.g. @fxml <ComboBox/>
Error message:
[error] /home/naftoli/dev/timer/javafx/src/main/scala/com/dev1on1/timer/Fxml.scala:28: class ComboBox takes type parameters
[error] <ComboBox><items>{SavedSearch("", "")}</items></ComboBox>
A workaround is
type MyComboBox = ComboBox[SavedSearch];
<MyComboBox>...</MyComboBox>
I probably will not "fix" this issue. There is no way to keep FXMLLoader's usage without breaking type-safety.
Our strict type checking can be considered as a feature instead a bug. Our type alias approach for generic controls is recommended as it is more type-safe than FXMLLoader's raw type.