Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Modify the update strategy of a binding after creation
Modify the update strategy of a binding after creation [message #1353030] Tue, 13 May 2014 18:53 Go to next message
Xavipen Mising name is currently offline Xavipen Mising nameFriend
Messages: 59
Registered: March 2011
Member
Hi,

Is there a way to modify the Update Policy in an already created binding, like:

//Pseudocode
Binding b = context.bindValue(uiElement, modelElement, targetToModel ( POLICY_NEVER ), modelToTarget (POLICY_UPDATE));

....
//Some condition

b.setTargetToModel(POLICY_UPDATE)
b.setModelToTarget(POLICY_NEVER)


As an alternative I have also try to remove the binding from the databinding context. like: One Action will call dataBindingContext.removeBinding(myBinding);
another dataBindingContext.addBinding(myBinding);

However, after running dataBindingContext.removeBinding(myBinding) I still see the changes in the UI.

Is there a way to "activate"/"deactivate" bindings? Could someone point my in the right direction?

Thanks in Advance
Javi
Re: Modify the update strategy of a binding after creation [message #1362828 is a reply to message #1353030] Sat, 17 May 2014 21:09 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
You should call Binding.dispose(), then you can re-bind the observables with new policies, DatabindingContext.removeBinding() will just remove it from its internal list (without de-coupling the observables)...


Xavipen Mising name wrote on Tue, 13 May 2014 20:53
Hi,

Is there a way to modify the Update Policy in an already created binding, like:

//Pseudocode
Binding b = context.bindValue(uiElement, modelElement, targetToModel ( POLICY_NEVER ), modelToTarget (POLICY_UPDATE));

....
//Some condition

b.setTargetToModel(POLICY_UPDATE)
b.setModelToTarget(POLICY_NEVER)


As an alternative I have also try to remove the binding from the databinding context. like: One Action will call dataBindingContext.removeBinding(myBinding);
another dataBindingContext.addBinding(myBinding);

However, after running dataBindingContext.removeBinding(myBinding) I still see the changes in the UI.

Is there a way to "activate"/"deactivate" bindings? Could someone point my in the right direction?

Thanks in Advance
Javi

Re: Modify the update strategy of a binding after creation [message #1385276 is a reply to message #1362828] Thu, 05 June 2014 10:37 Go to previous message
Xavipen Mising name is currently offline Xavipen Mising nameFriend
Messages: 59
Registered: March 2011
Member
Thanks for the clarification.
Previous Topic:Some errors from Jface...
Next Topic:FieldEditorPreferencePage
Goto Forum:
  


Current Time: Tue Apr 23 11:11:48 GMT 2024

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

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

Back to the top