Validation issue with IntegerEntityModelTextBoxEditor

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

you could use NotNullIntegerValidation which is a child of IntegerValidation - would that help? ----- Original Message -----
From: "Ramesh" <rnachimu@redhat.com> To: devel@ovirt.org Sent: Thursday, April 30, 2015 1:38:27 PM Subject: [ovirt-devel] Validation issue with IntegerEntityModelTextBoxEditor
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@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

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... 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@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

----- Original Message -----
From: "Lior Vernia" <lvernia@redhat.com> To: "Ramesh" <rnachimu@redhat.com> Cc: devel@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@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

On 30/04/15 15:03, Tomas Jelinek wrote:
----- Original Message -----
From: "Lior Vernia" <lvernia@redhat.com> To: "Ramesh" <rnachimu@redhat.com> Cc: devel@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.
Right, correct, I was mixing two issues. But yeah, definitely we should have some generic error to say that "this field is meant to contain integer numbers" and not return a null Integer.
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@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

please look into Alexander's patch: https://gerrit.ovirt.org/#/c/37244/ [userportal, webadmin: Number field reporting wrong error] - there is a chance that it resolves this issue. UI maintainers: any code-review assistance for this patch will be highly appreciated. ---- Thanks, Einav ----- Original Message -----
From: "Lior Vernia" <lvernia@redhat.com> To: "Tomas Jelinek" <tjelinek@redhat.com> Cc: devel@ovirt.org Sent: Thursday, April 30, 2015 8:08:02 AM Subject: Re: [ovirt-devel] Validation issue with IntegerEntityModelTextBoxEditor
On 30/04/15 15:03, Tomas Jelinek wrote:
----- Original Message -----
From: "Lior Vernia" <lvernia@redhat.com> To: "Ramesh" <rnachimu@redhat.com> Cc: devel@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.
Right, correct, I was mixing two issues. But yeah, definitely we should have some generic error to say that "this field is meant to contain integer numbers" and not return a null Integer.
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@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

On Thursday, April 30, 2015 09:10:34 AM Einav Cohen wrote:
please look into Alexander's patch: https://gerrit.ovirt.org/#/c/37244/ [userportal, webadmin: Number field reporting wrong error] - there is a chance that it resolves this issue.
UI maintainers: any code-review assistance for this patch will be highly appreciated.
Yes this patch specifically addresses the issue that you can't convert 'abc' into a number and it was reporting something like field cannot be empty due to it returning null to the model and the model validation did not allow null values.
---- Thanks, Einav
----- Original Message -----
From: "Lior Vernia" <lvernia@redhat.com> To: "Tomas Jelinek" <tjelinek@redhat.com> Cc: devel@ovirt.org Sent: Thursday, April 30, 2015 8:08:02 AM Subject: Re: [ovirt-devel] Validation issue with IntegerEntityModelTextBoxEditor> On 30/04/15 15:03, Tomas Jelinek wrote:
----- Original Message -----
From: "Lior Vernia" <lvernia@redhat.com> To: "Ramesh" <rnachimu@redhat.com> Cc: devel@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.
Right, correct, I was mixing two issues. But yeah, definitely we should have some generic error to say that "this field is meant to contain integer numbers" and not return a null Integer.
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@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
participants (5)
-
Alexander Wels
-
Einav Cohen
-
Lior Vernia
-
Ramesh
-
Tomas Jelinek