[ovirt-devel] IntegerEntityModelTextBox*, NumberEntityModelTextBox*, Validate

Tomas Jelinek tjelinek at redhat.com
Thu Jan 12 07:16:58 UTC 2017


Hi,

the validation should be done not on widget level but on the whole model
level. In case of the random generator which is in the VM dialog, it should
be validated in the UnitVmModel (the backing model of all the VM-like
entities) and inside it in the validate() method. Than this validate()
returns true/false if it is valid / invalid. And than the corresponding
list model (VmListModel.onSaveVm() for example) calls the validate and only
if it passes it should continue to send the data to server.

Is this not what happens?

Tomas

On Thu, Jan 12, 2017 at 2:38 AM, Tony Wang <sline798 at gmail.com> wrote:

> I find the TextBox Widget of ovirt-engine,such as
> IntegerEntityModelTextBoxEditor. They are weak in validation. When i
> input a string or something else can't parse Integer. In view, the widget
> will make as invalid, but i press the button of "OK", it always can pass.
> Even, when i edit the entity's attributes, such as Random Generator's
> Period or Bytes per period of VM, use IntegerEntityModelTextBox* widget, it
> will save the old data. I can't be sure this is a fault or is normal?
>
> _______________________________________________
> Devel mailing list
> Devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20170112/c5b075c4/attachment-0001.html>


More information about the Devel mailing list