[databinding] How to validate multiple properties cross-referenced [message #657567] |
Thu, 03 March 2011 10:19 |
Matteo Miraz Messages: 38 Registered: March 2011 |
Member |
|
|
Hi,
first of all, I'm a JFace newbie, so I kindly ask forgiveness if I ask a dummy question.
Suppose to have a model with three (integer) properties: a minimum value (min), a maximum value (max), and a default value (d). Obviously, these properties must satisfy the following two constraints:
(1) each of them must be a number
(2) min <= d <= max
I'm writing a JFace wizard so to allow the user to create an instance of such model.
Since I would like to provide the user with a notification about the errors in his inputs, I leverage the JFace validation framework, and I'm able to warn the user if he inserts an invalid number.
However, I'm stuck with the second constraint... how can I validate it?
Thanks,
Matteo
|
|
|
Re: [databinding] How to validate multiple properties cross-referenced [message #658240 is a reply to message #657567] |
Mon, 07 March 2011 14:47 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
As outlined in my other response you can't do this with IValidators on
the UpdateValueStrategy. The only possible solution is to implement an
IValidationStatusProvider on your DatabindingContext.
Tom
Am 03.03.11 11:19, schrieb Matteo:
> Hi,
>
> first of all, I'm a JFace newbie, so I kindly ask forgiveness if I ask a
> dummy question.
>
> Suppose to have a model with three (integer) properties: a minimum value
> (min), a maximum value (max), and a default value (d). Obviously, these
> properties must satisfy the following two constraints:
> (1) each of them must be a number
> (2) min <= d <= max
>
> I'm writing a JFace wizard so to allow the user to create an instance of
> such model. Since I would like to provide the user with a notification
> about the errors in his inputs, I leverage the JFace validation
> framework, and I'm able to warn the user if he inserts an invalid number.
> However, I'm stuck with the second constraint... how can I validate it?
>
> Thanks,
> Matteo
|
|
|
Powered by
FUDForum. Page generated in 0.03520 seconds