dooApp/FXForm2

Allow class level constraints to be reported on target fields

Closed this issue · 6 comments

Some class level constraints refer to a specific field but the need to be declared a class level because they require additional parameters to check the constraint. For example a field might be mandatory if another field has a specific value.

In this case, the constraint violations should be reported directly at the field level and not at the class level (at the top of the form in the default skins).

+1 to this improvement, I was looking for a way to be able to do this just now. Will this be in 8.0.8 release and when is this release scheduled?

This feature is already available in the 8.0.8-SNAPSHOT.

Run com.dooapp.fxform.Demo to see an example of class level constraint reported at property level (PasswordMatch, repeatPassword field) and a class level constraint reported at the top of the form (ColorAndDate)

I'd be interested to get your feedback on this before releasing this version.

Thank you.
I did try the 8.8-SNAPSHOT yesterday. So far, it seems to work very well. However, there is one strange comportment with class level constraints being reported on target fields.

When setting the source to the FXForm for the first time, the message for a given target field is displayed in the class level constraint block, not on the target field. Once modifying the text in the related field, the message gets reported at the correct location.

Apparently, another bug seems to occur when changing the values in a ChoiceBox from an enum field. Changing a value causes the following stack trace to be produced. I can't dig deeper, as the sources do not seem to be included in the latest snapshot. The same issue is not seen with 8.0.7.

Stacktrace here: http://pastebin.com/KAwhkfKh

Thanks for your feedback. Could you share tests classes helping me to reproduce these issues?

Fixed in 8.0.8