| Summary: | [DataBinding] WidgetProperties().focused() is still not updating properly | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dominik Maehl <emissary> | ||||||
| Component: | UI | Assignee: | Matthew Hall <qualidafial> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | daniel, mallo.ovidio, ob1.eclipse, tom.schindl | ||||||
| Version: | 3.6.2 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | stalebug | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 357568 | ||||||||
| Attachments: |
|
||||||||
|
Description
Dominik Maehl
What platform? We've reproduced the problem on Windows XP SP2 and Windows 7 with Eclipse 3.7.0 One possible workaround until this is fixed is to use WidgetProperties.focused().observeDelayed(widget, delay) with a very small delay (e.g. 0 or 1ms). Since it appears that the FocusOut event is sent just *before* the control loses focus, this delay will ensure that an event is not fired until just *after* focus is lost. The workaround does not work. I assume this has to do with observeDelayed() behaviour when the widget loses focus as the javadoc states "...which delays notification of value changes until at least delay milliseconds have elapsed since that last change event, or until a FocusOut event is received from the widget (whichever happens first)." So it essentially seems to trigger evaluation of the property at the same time as it would be triggered without observeDelayed(). Created attachment 203642 [details]
Patch
Dominik, does this patch fix the problem for you?
Created attachment 203643 [details]
mylyn/context/zip
The patch does indeed fix the problem for us. Thank you! (Dominik is on vacation right now) (In reply to comment #5) > Dominik, does this patch fix the problem for you? Ovidio, +1? Maybe we should make a "if (!event.widget.isDisposed()) { ... }" check inside the asyncExec's run method. I think it's always a good idea when you do something asynchronously. Also, you might want to add a reference to the bug to the file header.
Beside that, +1
(In reply to comment #9) > Maybe we should make a "if (!event.widget.isDisposed()) { ... }" check inside > the asyncExec's run method. > Also, you might want to add a reference to the bug to > the file header. Agreed on both points. I'll rework the patch. 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. If the bug is still relevant, please remove the stalebug whiteboard tag. |