Community
Participate
Working Groups
Build Identifier: 20100917-0705 I have been experimenting a bit with databindings. I have a dialog whose button i'd like to disable in certain conditions and this property I'd like to have a test for (i.e. some property does not hold -> button is diabled). I have done one test with a Text-field (that works). I have also done a very similar test with a DateTime-field (that fails however it works when I run the application). See attached code. I have two questions: 1) Is there someway to programmatically trigger an validation? 2) Have I missed something? If no: is the inconsistency between the behavior for DateTime and Text intended? Reproducible: Always
Created attachment 193461 [details] The code
Setting a value programmatically does not trigger an event in SWT so Databinding can't know you've modified the value. You can call DatabindingContext#updateModel to manually trigger syncing which will run the validation code.
... small note to Text-Field and why it works there. SWT.Modify is an exception to the rule of not notifying when something is set programmtically in SWT
Thanks!