Bug 116659 - [DataBinding] partial validation
Summary: [DataBinding] partial validation
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-11-16 08:59 EST by Joe Winchester CLA
Modified: 2019-09-06 16:04 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Winchester CLA 2005-11-16 08:59:05 EST
 
Comment 1 Gili Mendel CLA 2005-11-30 08:21:53 EST
More info please.
Comment 2 Joe Winchester CLA 2005-12-01 06:37:52 EST
Partial validation seems to work OK, except for the case where we have TIME_LATE.  In this case the isPartialValid(...) message is not called per keystroke.  Is the behavior we expect that isPartialValid(...) is called per keystroke with TIME_LATE and isValid(...) is only called just prior to the actual model being updated from the target ?
TextControlScenario.testScenario07() is commented d out right now (so we don't break the JUnits) but if you comment it in it shows that TIME_LATE does not call isPartialValid(...) per keystroke
Comment 3 Joe Winchester CLA 2005-12-02 05:52:49 EST
Folks,
Does anyone care to comment on whether partial validation should occur per keystroke with TIME_LATE ?  At the moment it doesn't, however my understanding is that partial validation should occur per keystroke irrespective of the update policy ?  I can implement it to do so, however in the current spirit of lots of bugzilla talk taking preference over writing code I'd like to get input before I fix it.
Comment 4 Dave Orme CLA 2005-12-02 10:49:06 EST
Joe,

Your original comments were right on the mark.

If we do partial validation at the same time as full validation (ie: on focus lost), there is no longer any need for partial validation.  But things like social security numbers and localized dates can benefit from keystroke-level validation even when the data isn't being committed until focus lost.
Comment 5 Joe Winchester CLA 2005-12-05 12:17:10 EST
> If we do partial validation at the same time as full validation (ie: on focus
> lost), there is no longer any need for partial validation

So what is SWTUpdatablePolicy.setValidatePolicy(...) for ?  If IValidator can do partial and full validation and we call partial per keystroke and full when the change event is fired (per keystroke on TIME_EARLY and focus on TIME_LATE) why do we have another switch ?  I can't see why validatePolicy(...) would ever be used.  At the moment we don't actually use the field - it is passed into the constructor of TextUpdatablePolicy but never referenced after that.

Are you OK if I just delete the concept of validate policy being a switch and we just keep updatePolicy ?
Comment 6 Dave Orme CLA 2005-12-05 12:40:34 EST
(In reply to comment #5)
> Are you OK if I just delete the concept of validate policy being a switch and
> we just keep updatePolicy ?

Yes.
Comment 7 Boris Bokowski CLA 2007-06-26 13:40:20 EDT
Partial validation is not implemented - our plan is to add direct support for masked editing instead.
Comment 8 Matt Carter CLA 2007-07-18 12:02:15 EDT
I need Partial Validation and have just had to replace it's functionality with a few VerifyListeners. I agree however given the positive refactoring that has taken place in the last few months that it should not/can not be implemented in Data Binding as "Partial Validation".

Masked editing sounds good.

My use case is simple: I don't want users to be able to enter non-numeric characters into Text controls bound to Numeric values. I had previously implemented this by setting non-primitive StringToXXValidators in the bindspec as a Partial Validator for numeric types.

I want this to be automatically handled by JFace Data Binding. It could perhaps  be made optional behaviour for when it is not desired.

I have looked at where "Edit Masks" can be logically added in the latest Data Binding without breaking Realms or the current API cleanliness. As an alternative I have looked at adding at least the facility to veto changes in Text controls using a Validator (to prevent entry of invalid values). One attempt I made was through introducing a vetoValidator to ValueChangeStrategy to allow veto of TextObservableValue changes before afterGetValidator. I stopped working down this path however due to the required Realm.exec() calls in ValueBinding.doUpdate() making it difficult/impossible to return a veto result to the change listener handleValueChange() methods to prevent the edit.

I wanted to confine this work to TextObservableValue, but that would involve queries of the type of the model observable type from the target which seems wrong (and also probably this information is inaccessible).

I still would like us to write a clean replacement for the relevant use cases behind "Partial Validation", such as mask editing.

Any ideas anyone as to how/where this should be implemented and to the extent of the proposed feature?
Comment 9 Boris Bokowski CLA 2007-07-18 12:22:23 EDT
Have you looked at Nebula's masked editing widget [1] yet?

[1] http://www.eclipse.org/nebula/widgets/formattedtext/formattedtext.php
Comment 10 Matt Carter CLA 2007-07-18 13:02:51 EDT
Hmm, attractive controls. I had not come across these, thanks.

If I set about writing an Observable for FormattedText and some form of automatic masking support (and possibly for binding some other Nebula widgets) would I be able to contribute it into Data Binding or would the code have to remain outside of the project?
Comment 11 Boris Bokowski CLA 2007-07-19 06:07:08 EDT
(In reply to comment #10)
> would I be able to contribute it into Data Binding or would the code have to
> remain outside of the project?

We cannot make the existing data binding plug-ins depend on Nebula, but how about contributing to the Nebula project?  You could file an enhancement request against Nebula to start a discussion about this. (Please add me to the cc list.)
Comment 12 Eclipse Webmaster CLA 2019-09-06 16:04:59 EDT
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.