Hi,
we use JFace Data Binding in RAP our application. The target observable value is created with a FocusOut event:
SWTObservables.observeText(myTextControl, SWT.FocusOut);
The expectation was that once the user has entered the field and tabs out to the next field, it is actually bound to the model.
I realized during testing, though, that with every keystroke in the text field the browser makes a request with a Modify Event. The reason seems to be that org.eclipse.jface.internal.databinding.swt.TextTextProperty internally registers a second (SWT.Modify) listner for its staleEvents, see:
private static int[] staleEvents(int[] changeEvents) {
if (changeEvents != null)
for (int i = 0; i < changeEvents.length; i++)
if (changeEvents[i] == SWT.Modify)
return null;
return new int[] { SWT.Modify };
}
Is there a way to avoid this behaviour and strictly validate and convert on FocusOut events?
I appreciate any feedback.
Thanks,
Alfred