Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » master-detail scenario
master-detail scenario [message #896096] Tue, 17 July 2012 09:11 Go to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 185
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 Go to previous message
Martin Jacob is currently offline Martin JacobFriend
Messages: 185
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
Previous Topic:[CDO] Incorrect Management of Null EEnum Objects
Next Topic:ID in derived EClass seems the same in different containments
Goto Forum:
  


Current Time: Mon Aug 19 23:33:55 GMT 2019

Powered by FUDForum. Page generated in 0.01885 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top