-
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 Message Properties #359
Comments
I understand your request but I don't know if a properties map at the ValidationMessage would be the best solution for this. My problem is that this is very implicit. The type of the key of the propertiesmap is Maybe you could add one or more properties to the ViewModel and use them to get your additional information from the ViewModel to the View? |
Regarding the properties map - it is loosely typed so that the it can be used by anyone using the validation framework for their own purposes. Is there a downside to this approach? JavaFx nodes can contain properties in much the same fashion and the api states:
(Note: I'm not suggesting an observable list since it would be immutable) If you aren't interested in adding in the feature, would you consider making ValidationMessage extendable (the constructor is not visible outside the package), so that I could create my own validation messages that still fit into the framework or probably better - make it an interface? |
I don't like the idea of a untyped map but I don't have a good alternative at hand. Making the ValidationMessage extendable sounds good. |
Can you take a look at this commit: ba853e2 In this commit I made the constructor of the |
That's exactly what I had done locally. That will work well - thanks :) |
Fix for #359. Made ValidationMessage class extendable
ok. It will be part of version 1.5.0 |
Currently ValidationMessage only contains the message and it's severity.
I would like you using the validators in a TableView. When an error is returned for a particular cell, I would like to add some additional information (eg. row and column). This will allow a user to select an error message and I could then highlight (or navigate to) the cell containing the error.
All that would be required would be a map of (optional) additional properties to be added to the messages.
for example you could overload the following:
ValidationMessage.error( String message, Map<String,Object> messageProperties );
Any thoughts or alternative approaches?
The text was updated successfully, but these errors were encountered: