Hi All,

 

I have two fields that gets integer values. When user inputs data only
numbers are allowed. When user leaves field, I add grouping seperators
automatically (with JS).

Now, the fields have one converter that converts the value with thousands
separator to integer value. If no data entered converter returns null, if
text data is entered (though I block it with JS, by doing copy paste it is
still possible), it return Double.NaN.

In addition, each field has a validator (the same validator) that checks
that data is valid, by testing if value is: Double.NaN and setting proper
error message.

The second field has an additional validator that validates that BOTH fields
are not empty. If both are empty it returns an error message.

 

It seems like when both fields are empty the validators are not activated. I
assume this is because my converter returns null value for the empty fields
(in the getAsObject method). Should I return some none-null value in order
for validators to be activated?

 

Thanks,

Guy.

Reply via email to