Bug 237856 - [Wizards] [DataBinding] WizardPageSupport class should track the staleness state of relevant observables
Summary: [Wizards] [DataBinding] WizardPageSupport class should track the staleness st...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Matthew Hall CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-06-19 17:57 EDT by Ovidio Mallo CLA
Modified: 2008-12-10 01:29 EST (History)
1 user (show)

See Also:


Attachments
proposed patch for the WizardPageSupport part (9.35 KB, patch)
2008-06-23 13:58 EDT, Ovidio Mallo CLA
qualidafial: iplog+
Details | Diff
Ovidio's patch merged with HEAD (7.32 KB, patch)
2008-10-23 13:45 EDT, Matthew Hall CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ovidio Mallo CLA 2008-06-19 17:57:43 EDT
I think the WizardPageSupport class should be extended to track the staleness state of the target/model observables and the validation status observable of all the ValidationStatusProviders of the given DataBindingContext. When any of those observables is stale, the given WizardPage should be set to be not complete. This is required to correctly handle things like DelayedObservableValues or eventual asynchronous validations which can otherwise not to be reliably used in conjunction with the WizardPageSupport class.
Comment 1 Boris Bokowski CLA 2008-06-21 17:39:37 EDT
Tracking the staleness of the status observables makes sense. I am not so sure about the model and target observables - under which circumstances would these be stale, and shouldn't we think about what this means for a binding, first?
Comment 2 Ovidio Mallo CLA 2008-06-22 04:35:35 EDT
Actually, my original intent was also to propose tracking the staleness of the validation status observable only. However, while writing the bug report, I have thought about the DelayedObservableValue which I think cannot be used reliably in conjunction with the WizardPageSupport class right now unless you wait for the delayed updates to have completed before allowing to eventually proceed in the wizard. That's why I thought that it might be beneficial to also track the staleness of the target observables. On the model side, I cannot think of a particularly relevant use case in practice.

However, you're totally right that it might not be so good to (artificially) check for the staleness of the target/model observables in the WizardPageSupport class since, if at all, the problem should indeed be handled more fundamentally by the binding. As an example, if the target of a binding becomes stale, one could argue that the binding's validation observable (I'm not sure about the model observable) should also be marked to be stale. Indeed, I think this would make sense.

So, I agree that the WizardPageSupport class should limit itself to tracking the staleness of the validation status observables only.
Comment 3 Boris Bokowski CLA 2008-06-22 04:45:38 EDT
Makes sense. By the way, the delayed observable value also hooks a focus listener and will update itself eagerly when the focus is no longer on the target control - but I haven't tried what happens when you try to click Next or Finish in a wizard containing a delayed value.

So ValueBinding would track the staleness of model and target (to make it symmetric) and make its status observable stale in response to that. Then WizardPageSupport would then track staleness of the status observable and mark the page as not complete.

Would you like to contribute a patch?
Comment 4 Ovidio Mallo CLA 2008-06-22 05:21:13 EDT
(In reply to comment #3)
> Makes sense. By the way, the delayed observable value also hooks a focus
> listener and will update itself eagerly when the focus is no longer on the
> target control - but I haven't tried what happens when you try to click Next or
> Finish in a wizard containing a delayed value.
I have also not tried it myself so I am not sure but I guess that at least as soon as you start using the key shortcuts to navigate in the wizard, it would not work reliably anymore.

> So ValueBinding would track the staleness of model and target (to make it
> symmetric) and make its status observable stale in response to that. Then
> WizardPageSupport would then track staleness of the status observable and mark
> the page as not complete.
What about the (List|Set)Bingings? There's no real validation there but maybe it still makes sense to implement it analogously for those.

> Would you like to contribute a patch?
I will look at it. Shall I create a separate bug report for the binding part?
Comment 5 Ovidio Mallo CLA 2008-06-22 05:32:45 EDT
By the way, I guess that in that case the MultiValidator should also be adapted to track the staleness state of the observables accessed during the execution of the validate() method and propagate that staleness state to its status observable.
Comment 6 Ovidio Mallo CLA 2008-06-23 13:58:19 EDT
Created attachment 105654 [details]
proposed patch for the WizardPageSupport part

As agreed upon, only the staleness of the validation status observables is tracked.
Comment 7 Ovidio Mallo CLA 2008-06-29 12:05:36 EDT
I have created a separate bug report for the staleness of the validation status observable of a Binding/MultiValidator: bug #238909
Comment 8 Ovidio Mallo CLA 2008-10-22 13:55:22 EDT
Matthew, I had a brief look at bug #239900 where you seem to already track the staleness of the validation for the new DialogPageSupport class and its subclasses so this bug here may be obsolete by now.
Comment 9 Matthew Hall CLA 2008-10-22 14:23:34 EDT
(In reply to comment #8)
> Matthew, I had a brief look at bug #239900 where you seem to already track the
> staleness of the validation for the new DialogPageSupport class and its
> subclasses so this bug here may be obsolete by now.

True, but your patch contains tests so we should at least keep those.
Comment 10 Matthew Hall CLA 2008-10-23 13:45:23 EDT
Created attachment 115962 [details]
Ovidio's patch merged with HEAD
Comment 11 Matthew Hall CLA 2008-10-23 13:48:20 EDT
Good thing we kept your patch--the new test caught a bug in DialogPageSupport.

Released to HEAD > 20081023
Comment 12 Matthew Hall CLA 2008-12-10 01:28:46 EST
Verified in I20081209-0100 by code inspection and by running test suite