Community
Participate
Working Groups
I would be nice if it would be possible to add a VerifyListener to the DateTime control in SWT. I tried to invalidate the user's selection of a date when it was after the date of another DateTime widget and then leave the widget back with the date it originally had. I tried to do this using a SelectionListener and the 'e.doit' property, but that doesn't seem to work. This code illustrates what I was trying to do: dateTimeStart.addSelectionListener(new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { } @Override public void widgetSelected(SelectionEvent e) { if (dateIsBeforeOtherDate()) //The date is NOT valid. The user's input should be invalidated. e.doit = false; else /The date is valid. The user's input should be copied to the corresponding property in the data model. setNewDateInModel(); } }); This code doesn't work. Eventhough e.doit is set to false, the input of the DateTime widget still changes. The solution would be to add a VerifyListener to the DateTime control, but this is currently not possible.
Also please add SWT.Modify event (to have a chance share common listeners with Text controls). And requested SWT.Verify event is absolutely needed to make things like setting the min/max limits for date/time.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.