[Databinding] Force a validation of a field [message #899276] |
Tue, 31 July 2012 06:12  |
Eclipse User |
|
|
|
Hello,
I have a dialog on which I have several widgets and I use JFace databinding to link the widgets to my model. I also use validators for some of the fields (with control decoration support).
The validation of one of the fields on the dialog depends somehow on other fields. To make it concrete: the dialog allows the user to define parameter data (name, type, default value, ...). The default value field is validated depending on the chosen type. So, whenever the user changes the type, the default value field has to be revalidated (and an error decoration needs to be displayed in case of error).
I tried to listen on modification of the type binding and then call "validateTargetToModel" on the default value binding but this doesn't solve my problem.
How can I make sure that the status and visible state of the default value field is updated when I change the type field ?
Thanks
|
|
|
|
Re: [Databinding] Force a validation of a field [message #899483 is a reply to message #899300] |
Wed, 01 August 2012 02:58  |
Eclipse User |
|
|
|
Hello Jan,
Thanks for the reply. After checking my code I realized that the validation code was wrong (it was using values from the model, which of course were not up to date because the validation happens before the value is set to the model).
So the behaviour was that the validation didn't work properly in all cases. This is now fixed and it works properly.
|
|
|
Powered by
FUDForum. Page generated in 0.05972 seconds