|Re: Data binding of dates and times [message #1231261 is a reply to message #1181425]
||Tue, 14 January 2014 07:52
| Baruch Youssin
Registered: April 2013
I have found an answer myself.|
The DateTime control has selection property which is of type Date and can be bound to a bean property of type Date.
(Date is a type that is used just as a wrapper for the time indicated as the number of milliseconds, see http://docs.oracle.com/javase/7/docs/api/java/util/Date.html )
This binding can be done through the Bindings tab as usual.
(However, the JFace Automatic Databinding feature of WindowBuilder does not offer to bind a bean property of Date type to a DateTime control; it offers to bind it only to a Text control.
If you want to use JFace Automatic Databinding first to create a composite with bindings to other bean properties and after that add your DateTime controls to bind them to your Date properties, you may run into a WindowBuilder bug (or a weird feature?) if you ask JFace Automatic Databinding to create a Controller class for you, as follows.
Adding a DateTime control from Palette places its constructor in the code after the constructor of the Controller class that does the databinding. As the result, the latter constructor attempts to bind the DateTime control while it is still null, and fails. You can fix it by interchanging the constructors manually.)
[Updated on: Tue, 14 January 2014 07:53]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01745 seconds