Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343087 - [Databinding] Datetime#setDate does not trigger re-validation
Summary: [Databinding] Datetime#setDate does not trigger re-validation
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-18 02:22 EDT by Mats-Ola Persson CLA
Modified: 2011-04-18 04:54 EDT (History)
1 user (show)

See Also:


Attachments
The code (4.64 KB, application/octet-stream)
2011-04-18 02:23 EDT, Mats-Ola Persson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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!