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

Setting a custom StringConverter on an IntegerField can break the Spinner in SimpleIntegerControl #46

Open
sten-navie opened this issue Apr 11, 2019 · 0 comments

Comments

@sten-navie
Copy link

One can set a custom StringConverter on an IntegerField via IntegerField.format(..)
The default control for IntegerField, SimpleIntegerControl is a wrapper around an Integer based spinner. Setting a custom StringConverter on the field seems to break the spinner up-down feature, as the spinner is not aware of the StringConverter on the field. Editing the field by typing into the text-field part of the spinner works as expected.

Workaround:

  • Override SimpleIntegerControl and apply the custom converter in the "initializeParts" method.
@Override
public void initializeParts() {
    super.initializeParts();
    editableSpinner.getValueFactory().setConverter(myCustomConverter);
}
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

1 participant