Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343087

Summary: [Databinding] Datetime#setDate does not trigger re-validation
Product: [Eclipse Project] Platform Reporter: Mats-Ola Persson <deathpolli>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: tom.schindl
Version: 4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The code none

Description Mats-Ola Persson CLA 2011-04-18 02:22:55 EDT
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
Comment 1 Mats-Ola Persson CLA 2011-04-18 02:23:38 EDT
Created attachment 193461 [details]
The code
Comment 2 Thomas Schindl CLA 2011-04-18 02:41:51 EDT
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.
Comment 3 Thomas Schindl CLA 2011-04-18 02:42:55 EDT
... 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
Comment 4 Mats-Ola Persson CLA 2011-04-18 04:54:43 EDT
Thanks!