Community
Participate
Working Groups
ComboObservableValue fails to update cached currentValue during the doSetValue(...) call. As the result, event may not fire if the next combo selection happens to be the same as cached value. Proposed change (new lines end with // FIX): public void modifyText(ModifyEvent e) { if (!updating) { String oldValue = currentValue; currentValue = ComboObservableValue.this.combo.getText(); fireValueChange(Diffs.createValueDiff(oldValue, currentValue)); } else // FIX currentValue = ComboObservableValue.this.combo.getText(); // FIX
Moving to M3.
This bug occurs whenever the model is changed. Change the value of the model will be reflected in the widget but not cached in the Observable. The Observable's concept of "current" or "previous" value is now out of sync with the Combo widget. Assuming that the ComboObservableValue's currentValue is supposed to mirror what the widget shows, a better fix would be to change doSetValue() from: } finally { updating = false; } fireValueChange(Diffs.createValueDiff(oldValue, combo.getText())); to: } finally { // ensure that the Observable is in sync with the widget currentValue = combo.getText(); updating = false; } fireValueChange(Diffs.createValueDiff(oldValue, currentValue)); This should cause any modification from the model (including failed setting of the combo in the case of read only combo list) to be mirrored in the cached currentValue.
Is anyone interested in contributing[1] a patch? [1] http://wiki.eclipse.org/JFace_Data_Binding/How_to_Contribute
Created attachment 80899 [details] patch against 3.3 maintenance branch This fixes the bug against 3.3 maintenance branch. There are changes in HEAD that differs between CCombo and Combo so I made no attempt to create a patch against it.
The patch did not apply cleanly to HEAD, but I was able to make the same kind of change. Thanks for your help!
Fix released to HEAD.
Verified by code inspection using I20071211-0010.