Geeksltd / Olive

Olive framework, for more productive cross platform .NET solutions. It's available under the GPL v3 license. See License.md for more information.
https://geeksltd.github.io/Olive
Other
44 stars 44 forks source link

Validation tooltip messages not showing for mandatory radio button fields #243

Closed ShivSGeeks closed 5 years ago

ShivSGeeks commented 5 years ago

In the Model, we have set a property as mandatory:

olive-radio-01

In the form for add/editing, we have set the control type for this property to be horizontal radio buttons:

olive-radio-02

However, when we click Save without anything entered/selected for this field, no validation tooltip message appears for it. It will instead only appear in a pop-up/alert message box, once other required fields have been filled in:

olive-radio-03

This is also happening when the control type is set to vertical radio buttons, as well as when attempting to add a .Mandatory() or .RequiredValidationMessage() parameter for it.

But when it is set to, for example, a dropdown list or autocomplete field, the tooltip message will appear without issue.

This was also checked with the latest Olive packages.

iPazooki commented 5 years ago

Hi @ShivSGeeks

This issue is related to using VisibleIf() method. I believe if you remove this method it will work properly. if this property is mandatory it should be filled in any cases, but you just want to make it mandatory if it meets some criteria. so I reckon you should change your logic a little bit.

ShivSGeeks commented 5 years ago

Hey @iPazooki

I had a look into this again based on what you suggested and unfortunately, this is not the case.

Even after removing all extra parameters for the field (including VisibleIf() and CustomDataSave()) and only just keeping the field being displayed as radio buttons, the validation tooltip message still does not appear on the form. The closest where you get a validation message for the field is only in a pop-up box when saving.

olive-radio-04 olive-radio-05

If the field was using the default control type or a dropdown/autocomplete field, the tooltip validation message appears without issue:

olive-radio-06

This is still happening, even with new Olive updates made available during the past couple of days.

ShivSGeeks commented 5 years ago

After discussing with @iPazooki and after further investigations into this, it was confirmed that the issue was the result of custom styling that was carried out for the custom radio buttons.

The item(s) containing the ".handled" class name must not be hidden from view, in order for the validation tooltip messages to appear when clicking Save.

Consider this now resolved.