[ovirt-devel] Validation issue with IntegerEntityModelTextBoxEditor

Tomas Jelinek tjelinek at redhat.com
Thu Apr 30 12:03:37 UTC 2015



----- Original Message -----
> From: "Lior Vernia" <lvernia at redhat.com>
> To: "Ramesh" <rnachimu at redhat.com>
> Cc: devel at ovirt.org
> Sent: Thursday, April 30, 2015 1:50:07 PM
> Subject: Re: [ovirt-devel] Validation issue with	IntegerEntityModelTextBoxEditor
> 
> I think it's an issue with other validations as well - "we" typically
> return true for frontend validations if the Object being validated is of
> the wrong type.
> 
> In my opinion, it would be better to let a ClassCastException be thrown
> to allow developers see they're doing something wrong...

but IFAIU this is a different issue - if you as a user type "abc" into a field which is allowed to have integer in it only, than the class cast exception is not a good thing to do.

And since you have nothing better to return than null in this case, it is up to validation to tell that it is not correct.

> 
> On 30/04/15 14:38, Ramesh wrote:
> > Hi,
> > 
> >  We have a validation issue with IntegerEntityModelTextBoxEditor. It
> > converts non numeric values as null to the model. As a result
> > IntegerValidation.validate() will be success always even in case of non
> > integer value.
> > 
> > Any suggestion to fix this issue?.
> > 
> > Regards,
> > Ramesh
> > _______________________________________________
> > Devel mailing list
> > Devel at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/devel
> _______________________________________________
> Devel mailing list
> Devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/devel
> 



More information about the Devel mailing list