|
|
|
|
|
|
Re: EMF Validation called 4 times for each binding [message #899475 is a reply to message #899305] |
Wed, 01 August 2012 05:44 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Not really. bindValue will initially force an model => target update I
guess to work around the problem you should create your
aggregateValidationStatus after the initial binding is done.
Tom
Am 31.07.12 14:33, schrieb Simon Barnett:
> OK, I figured out that it wasn't the dependencies after all - it's
> related to the initial bindings.
>
> I have a table in the master section which lists items and when the
> editor first fires up, it binds the fields (mainly text fields) in the
> details section to the selected item in the master table.
> This binding is done like this:-
>
>
> IWidgetValueProperty textProp = WidgetProperties.text(SWT.Modify);
>
> IObservableValue uiObs = textProp.observeDelayed(400, textField);
> IObservableValue modelObs;
>
> if (object instanceof IObservableValue) {
> modelObs = EMFEditProperties.value(domain,
> feature).observeDetail(
> (IObservableValue) object);
> } else {
> modelObs = EMFEditProperties.value(domain,
> feature).observe(object);
> }
>
> binding = bindingCtxt.bindValue(uiObs, modelObs);
>
>
> This binding causes the ValueChange event to be fired 4 times - so if I
> have 6 text fields bound then I get 24 ValueChangeEvents.
>
> Once the initial binding has been done, if i then change the value of
> any one of those text fields in the details section, I only get one
> ValueChangeEvent.
>
> So it's that first binding that's causing the extra change events. Any
> idea why that might be?
|
|
|
|
|
|
|
|
Re: EMF Validation called 4 times for each binding [message #899637 is a reply to message #899591] |
Wed, 01 August 2012 15:59 |
Simon Barnett Messages: 28 Registered: July 2012 |
Junior Member |
|
|
Argh, I've nearly got it all working now - except I can't get a table to bind properly.
So as well as some text fields and combos, I have a table in the details section which should be bound to a collection within the selected item in the master table.
I've currently got the binding written like this:-
IObservableList list = EMFObservables.observeDetailList(
Realm.getDefault(),
EMFProperties.value(ModelPackage.Literals.MODEL__ITEMS).observeDetail(sel),
detailsTableFeature);
ViewerSupport.bind(detailsTableViewer, list,
EMFProperties.values(columnFeatures));
But that doesn't work - the details table is empty.
However, if I use the following code:-
IObservableList list = EMFObservables.observeList(Realm.getDefault(),
model.getItems().get(1),
detailsTableFeature);*/
it will show the correct list of sub-items for item 1 in the model.
So I'm close - I just need to know what the 2nd argument to observeDetailList() should look like.
|
|
|
Re: EMF Validation called 4 times for each binding [message #899725 is a reply to message #899637] |
Thu, 02 August 2012 06:29 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Am 01.08.12 17:59, schrieb Simon Barnett:
> Argh, I've nearly got it all working now - except I can't get a table to
> bind properly.
>
> So as well as some text fields and combos, I have a table in the details
> section which should be bound to a collection within the selected item
> in the master table.
>
> I've currently got the binding written like this:-
>
> IObservableList list = EMFObservables.observeDetailList(
> Realm.getDefault(),
>
> EMFProperties.value(ModelPackage.Literals.MODEL__ITEMS).observeDetail(sel),
> detailsTableFeature);
>
> ViewerSupport.bind(detailsTableViewer, list,
> EMFProperties.values(columnFeatures));
>
IObservableList list =
EMFProperties.list(ModelPackage.Literals.MODEL__ITEMS).observeDetail(sel);
ViewerSupport.bind(detailsTableViewer,
list,EMFProperties.values(columnFeatures));
*You don't use EMFObservables any more at all*
Tom
|
|
|
|
Powered by
FUDForum. Page generated in 0.04507 seconds