-
Notifications
You must be signed in to change notification settings - Fork 104
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
Validation does not show Visualization in TableView (TextFieldTableCell) #546
Comments
Your validator setup looks good but I think the setup of the cellfactory is not correct. You are initializing the visualizer for one cell-value and one specific cell. However, JavaFX is reusing cells for different values. It will only create as many cells as needed for one view of elements in the table and it will reuse them when the user scrolls down. The setup of a Ok, so how to fix this? I have to admit that I haven't used the validation within a TableView yet. The basic assumption of the validation module is that there is a one-to-one connection between a value and a control in the view (which is typically the case for forms). This assumption isn't true for Tables so we have to find a workaround. In I don't have a ready-to-use solution but I'm trying to find one. |
Yeah cool! Thanks for the help, I will try this out. In JabRef we have a custom icon decorater that hopefully looks better. |
The only odd effect I encounter is the following: |
I don't know the internals of how and when re-render is done in JavaFX TableViews. |
I have created a very simple TableView with two columns and added a ValidiationVisualizer to the TextFieldTableCell. The validation triggers correctly, but there is no visual clue shown.
I tried different Decorators etc. but I could not figure it out. Any help would be appreciated!
This is the code I used to setup the table:
https://github.com/JabRef/jabref/pull/3735/files#diff-117aa7fc99c0b7380bdaf11022bb3575
In my ViewModel I have the Validator:
https://github.com/JabRef/jabref/pull/3735/files#diff-df16f2f707ba7bfd296b444ac7962c20
The text was updated successfully, but these errors were encountered: