[DataBinding] Preventing model changes that are not actually different [message #320709] |
Thu, 27 September 2007 16:21 |
Eclipse User |
|
|
|
Originally posted by: eclipse5.rizzoweb.com
Is there any (simple) way to prevent a binding from setting the model
value if the widget value has not actually changed? For example, if I
create an SWT observable for a Text on the FocusOut event, I'd like to
prevent the model from being set if the text has not changed.
TIA,
Eric
|
|
|
Re: [DataBinding] Preventing model changes that are not actually different [message #320765 is a reply to message #320709] |
Mon, 01 October 2007 07:45 |
Eclipse User |
|
|
|
Originally posted by: sf.tragwerk-dresden.de
Hi Eric,
1. setting the Event to SWT.Modify is a way to achieve this behaviour
for textfields.
i opened a bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=180746 to
get a similar performance like SWT.FOCUS_OUT.
if this is what you want, please vote for the bug.
2. you could write your own validator which caches and compares the
input. but you must live with a validation error when you want to stop
the current model update.
3. when you use BeansObservables by implementing / delegating to
java.beans.PropertyChangeSupport, the change event is fired on
differences only. this does not prevent you from calling the setter
method on your model, but prevents you from unnessecary observer operations.
Sebastian
Eric Rizzo schrieb:
> Is there any (simple) way to prevent a binding from setting the model
> value if the widget value has not actually changed? For example, if I
> create an SWT observable for a Text on the FocusOut event, I'd like to
> prevent the model from being set if the text has not changed.
>
> TIA,
> Eric
|
|
|
Re: [DataBinding] Preventing model changes that are not actually different [message #320827 is a reply to message #320709] |
Tue, 02 October 2007 17:11 |
Eclipse User |
|
|
|
Originally posted by: bokowski.ca.ibm.com
Hi Eric,
Can you file a bug for this? What you describe should be the default
behaviour, and it seems that the text observable value is firing events when
it shouldn't.
Boris
"Eric Rizzo" <eclipse5@rizzoweb.com> wrote in message
news:fdglb1$kp7$1@build.eclipse.org...
> Is there any (simple) way to prevent a binding from setting the model
> value if the widget value has not actually changed? For example, if I
> create an SWT observable for a Text on the FocusOut event, I'd like to
> prevent the model from being set if the text has not changed.
>
> TIA,
> Eric
|
|
|
|
Powered by
FUDForum. Page generated in 0.04118 seconds