Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic javafx controls don't work #51

Open
nafg opened this issue May 26, 2017 · 3 comments
Open

Generic javafx controls don't work #51

nafg opened this issue May 26, 2017 · 3 comments

Comments

@nafg
Copy link

nafg commented May 26, 2017

E.g. @fxml <ComboBox/>

@Atry
Copy link
Collaborator

Atry commented May 26, 2017

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>

@Atry
Copy link
Collaborator

Atry commented May 26, 2017

A workaround is

type MyComboBox = ComboBox[SavedSearch];
<MyComboBox>...</MyComboBox>

@Atry
Copy link
Collaborator

Atry commented Jul 28, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants