master-detail scenario [message #896096] |
Tue, 17 July 2012 09:11 |
Martin Jacob Messages: 191 Registered: July 2009 |
Senior Member |
|
|
Hi,
I run into a problem in a master detail scenario.
I have combo A and the content of combo B depends on the selection in combo A.
I have found an answer from Thomas Schindl
(http://www.eclipse.org/forums/index.php/mv/msg/161715/511328/#msg_511328) and wonder if it is still
valid or if there is another solution by today?
If still valid I need to "unbind" the observables.
I bind the combo as follow:
protected void bindCombo(Combo pCombo, EObject pObj, EStructuralFeature pFeature,
UpdateValueStrategy pTargetToModel,
UpdateValueStrategy pModelToTarget) {
EMFDataBindingContext lCtx = new EMFDataBindingContext();
IEMFEditValueProperty lProp = EMFEditProperties.value(editingDomain, pFeature);
IObservableValue lOvModel = lProp.observe(pObj);
IObservableValue lOvTarget = WidgetProperties.selection().observe(pCombo);
lCtx.bindValue(lOvTarget, lOvModel, pTargetToModel, pModelToTarget);
}
To unbind i need to keep lOvTarget and lOvModel and have to call lOvTarget.dispose() and
lOvModel.dispose()?
Is this right or do I need to do anything in addition?
and hints would be appreciated, Martin
|
|
|
Re: master-detail scenario [message #896366 is a reply to message #896096] |
Wed, 18 July 2012 08:11 |
Martin Jacob Messages: 191 Registered: July 2009 |
Senior Member |
|
|
In the mean time I try the way as described below to dispose lOvTarget and lOvModel when updating
the content of combo B. After update I bind combo B again.
All works fine :)
Martin
Martin Jacob wrote, On 17.07.2012 11:11:
> Hi,
>
> I run into a problem in a master detail scenario.
> I have combo A and the content of combo B depends on the selection in combo A.
> I have found an answer from Thomas Schindl
> (http://www.eclipse.org/forums/index.php/mv/msg/161715/511328/#msg_511328) and wonder if it is still
> valid or if there is another solution by today?
>
> If still valid I need to "unbind" the observables.
> I bind the combo as follow:
> protected void bindCombo(Combo pCombo, EObject pObj, EStructuralFeature pFeature,
> UpdateValueStrategy pTargetToModel,
> UpdateValueStrategy pModelToTarget) {
> EMFDataBindingContext lCtx = new EMFDataBindingContext();
> IEMFEditValueProperty lProp = EMFEditProperties.value(editingDomain, pFeature);
> IObservableValue lOvModel = lProp.observe(pObj);
> IObservableValue lOvTarget = WidgetProperties.selection().observe(pCombo);
> lCtx.bindValue(lOvTarget, lOvModel, pTargetToModel, pModelToTarget);
> }
>
> To unbind i need to keep lOvTarget and lOvModel and have to call lOvTarget.dispose() and
> lOvModel.dispose()?
>
> Is this right or do I need to do anything in addition?
>
>
> and hints would be appreciated, Martin
|
|
|
Powered by
FUDForum. Page generated in 0.02980 seconds