Skip to main content



      Home
Home » Eclipse Projects » JFace » [Databinding] Force a validation of a field
[Databinding] Force a validation of a field [message #899276] Tue, 31 July 2012 06:12 Go to next message
Eclipse UserFriend
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 #899300 is a reply to message #899276] Tue, 31 July 2012 08:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

calling validateTargetToModel should IMHO do exactly what you want. Did you debug it?

Or you can use the MultiValidator
http://eclipsesource.com/blogs/2009/02/27/databinding-crossvalidation-with-a-multivalidator/
Re: [Databinding] Force a validation of a field [message #899483 is a reply to message #899300] Wed, 01 August 2012 02:58 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Reset DeferredTreeContentManager
Next Topic:ViewerFilter Minimize Flickering Where To Call Table.setRedraw(false)
Goto Forum:
  


Current Time: Sat Jul 12 21:26:05 EDT 2025

Powered by FUDForum. Page generated in 0.05972 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top