Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 169637 - [DataBinding] Multiple validation statuses per binding
Summary: [DataBinding] Multiple validation statuses per binding
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Brad Reynolds CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 136280 169979 (view as bug list)
Depends on:
Blocks: 154132 159768
  Show dependency tree
 
Reported: 2007-01-04 23:33 EST by Brad Reynolds CLA
Modified: 2007-05-02 20:43 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brad Reynolds CLA 2007-01-04 23:33:02 EST
The current implementation of Data Binding assumes that all validation is fail fast and only one status can be reported.  There's a proposal on the table for returning multiple statuses in forms and dialogs (see bug 168769).  We need to make a decision on if we want to stick to the fail fast implementation for 1.0 or move to something to support the coming enhancements in forms and dialogs.  Another thing to consider is validation policies.  I was looking at implementing the explicit policy in ValueBinding and ran into an issue with the validation policy.  The idea for this policy was to support validation in dialogs where we don't want to update the model automatically but we still want to perform validation as the user is entering the data.  There's another use case of wanting to defer expensive validation until the user selects OK/Apply.

The dialog validation and multiple statuses might be 2 separate issues but it might help to evaluate both when discussing this enhancement.  Also this is a high priority as it effects API and 3.3M5 is the API freeze.  I'm willing to start work on this this weekend (as long as no one else claims it) if necessary and as long as we can come to an agreement on what to do.
Comment 1 Dave Orme CLA 2007-01-04 23:35:36 EST
Boris, please call me at your convenience so we can discuss this.
Comment 2 Brad Reynolds CLA 2007-01-13 14:01:35 EST
Has anything come of this?(In reply to comment #1)
> Boris, please call me at your convenience so we can discuss this.
> 

Has anything come of this?
Comment 3 Boris Bokowski CLA 2007-01-13 21:32:11 EST
(In reply to comment #2)
> Has anything come of this?

No, not yet - thanks for the reminder.
Comment 4 Brad Reynolds CLA 2007-02-24 12:33:17 EST
I'd like to propose that we move forward with this before 1.0.  The main reason is that I'd like to make the pipeline aware of IStatus.WARNING and IStatus.INFO and to define the pipeline behavior for these statuses.  When either are returned from a validator I'd like for the pipeline to continue processing but to maintain them as the status for the binding.  Further down the line if an IStatus.ERROR is encountered the process will terminate.  The use case that I'm thinking about is duplicate checking.  The end user is entering a phone number and the system should check for duplicates before proceeding.  If a duplicate is found it doesn't necessarily mean that the current entry is invalid.  It could just mean that further investigation is needed but the user can't be forced to perform that checking at this point in time.  So we need to flag the data with a warning but still propagate the value to the model.

What I'd like to propose is that if a status other than ERROR or CANCEL is returned from validation we proceed and maintain any status other than OK in a MultiStatus as the validation status for the binding.
Comment 5 Brad Reynolds CLA 2007-03-27 13:54:31 EDT
(In reply to comment #0)
> The dialog validation and multiple statuses might be 2 separate issues but it
> might help to evaluate both when discussing this enhancement.  

The validation policy issues have been resolved in 3.3M6.

> Also this is a
> high priority as it effects API and 3.3M5 is the API freeze. 

I think this can be implemented without any new API and it would be the correct thing to do.  The validation status would need to be a MultiStatus rather than just a Status.
Comment 6 Boris Bokowski CLA 2007-03-27 20:32:41 EDT
(In reply to comment #5)
> I think this can be implemented without any new API and it would be the correct
> thing to do.  The validation status would need to be a MultiStatus rather than
> just a Status.

+1 (make sure the severity of the multistatus reflects the most severe child status)
Comment 7 Brad Reynolds CLA 2007-03-28 16:35:34 EDT
This has been approved by the PMC[1] to implement in 3.3M7.

http://dev.eclipse.org/mhonarc/lists/eclipse-pmc/msg00156.html
Comment 8 Peter Centgraf CLA 2007-04-02 15:34:50 EDT
My patch from bug 147489 might be useful here.
Comment 9 Brad Reynolds CLA 2007-04-04 01:15:10 EDT
(In reply to comment #6)
> +1 (make sure the severity of the multistatus reflects the most severe child
> status)
> 

I'm assuming this means to reflect the other attributes as well (e.g. code, message, severity, and plug-in).
Comment 10 Brad Reynolds CLA 2007-04-04 21:50:31 EDT
FIXED > 20070404.
Comment 11 Brad Reynolds CLA 2007-04-04 21:54:06 EDT
*** Bug 136280 has been marked as a duplicate of this bug. ***
Comment 12 Brad Reynolds CLA 2007-04-04 21:56:29 EDT
*** Bug 169979 has been marked as a duplicate of this bug. ***
Comment 13 Brad Reynolds CLA 2007-05-02 20:43:23 EDT
VERIFIED in I20070502-1336.