Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 136280 - [DataBinding] Validation warning and error
Summary: [DataBinding] Validation warning and error
Status: RESOLVED DUPLICATE of bug 169637
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-12 02:59 EDT by Sébastien Letélié CLA
Modified: 2007-04-04 21:54 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sébastien Letélié CLA 2006-04-12 02:59:43 EDT
With the "partially validation" the event prevent user from writing in the field if the condition is invalid (Validator.isPartiallyValid()). Sometimes you just want to ask the user that what is writing is not valid and not refusing.
The ValidationError object have 2 state WARNING and ERROR, but this difference is not used.

I modify the code in the ValueBinding class to change the behave of the targetChangingListener :

    private final IValueChangingListener targetChangingListener = new IValueChangingListener() {
        public boolean handleValueChanging(IVetoableValue source, ValueDiff diff) {
            if (updating)
                return true;
            // we are notified of a pending change, do validation
            // and veto the change if it is not valid
            Object value = diff.getNewValue();
            ValidationError partialValidationError = targetValidator
                    .isPartiallyValid(value);
            partialValidationErrorObservable.setValue(partialValidationError);
            return partialValidationError == null || partialValidationError.status == ValidationError.WARNING;
        }
    };

Then i the state is error the writing is refused, if the state is warning the ValidationError is returned but the writing is accepted.
Comment 1 Brad Reynolds CLA 2007-04-04 21:54:06 EDT
We've added the ability to return WARNING and INFO from a validator and it will not terminate the update in bug 169637.  Marking as a duplicate of 169637.

*** This bug has been marked as a duplicate of bug 169637 ***