Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [Databinding] Problems with multiple actions in a checkbox(When I select a checkbox I'm modifyng another attribute, binded to a Text, that's not automatically updated)
[Databinding] Problems with multiple actions in a checkbox [message #940439] Thu, 11 October 2012 16:33 Go to next message
Mauricio Reyes is currently offline Mauricio Reyes
Messages: 25
Registered: August 2011
Junior Member
Hi, I'm having a problem with an SWT Dialog, where I've one Checkbox and one Text. When checkbox is changed setBooleanAttribute(boolean value) method is called through databinding, and after setting the attribute, the method changes the value of another attribute, which is binded to the Text component.

The issue I'm facing is the update of Text value, that is not being modified when the model's attribute changes through setBooleanAttribute.

I'm generating the binding with Window Builder and model elements are two separate objects. The following code is the generated binding and a simplified example version of the triggered sets explained before:

		IObservableValue btnManejaDominioObserveSelectionObserveWidget_1 = SWTObservables.observeSelection(btnManejaDominio);
		IObservableValue controladorManejaDominioObserveValue = PojoObservables.observeValue(controlador, "manejaDominio");
		bindingContext.bindValue(btnManejaDominioObserveSelectionObserveWidget_1, controladorManejaDominioObserveValue, null, null);
		
		IObservableValue textObserveTextObserveWidget = SWTObservables.observeText(text, SWT.Modify);
		IObservableValue controladorDominioAdapternombreObserveValue = PojoObservables.observeValue(controlador, "dominioAdapter.nombre");
		bindingContext.bindValue(textObserveTextObserveWidget, controladorDominioAdapternombreObserveValue, null, null);
		
                
		// FIRST SET (Boolean)
		public void setManejaDominio(Boolean manejaDominio) {
			this.manejaDominio = manejaDominio;
			this.dominioAdapter.setNombre("Default Nombre");
		}
		
		// SECOND SET (Called from the first)
		public void setNombre(String nombre){
			this.nombre = nombre;
		}


I'm not sure if databinding is wrongly configured or has to do with composite layout. When I debug the values are properly set in the model.

How can I react to those model changes in GUI?

Thanks in advance
Mauricio
Re: [Databinding] Problems with multiple actions in a checkbox [message #945684 is a reply to message #940439] Mon, 15 October 2012 14:33 Go to previous message
Mauricio Reyes is currently offline Mauricio Reyes
Messages: 25
Registered: August 2011
Junior Member
I was working over the wrong concept that binding from model to GUI was automatically done. The missing actor in my model was PropertyChangeSupport, with that point added and changing PojoObservables to BeansObservables I achieved bidirectionality.

These are useful resources:
Eclipsepedia - Pojo Bindable & JFace Databinding

JBoss Tools - Eclipse wizards with jface databinding in Deltacloud Tools (1)
https: //community.jboss.org/wiki/EclipsewizardswithjfacedatabindinginDeltacloudTools1
Previous Topic:JFace CellEditor- Table cell click actions
Next Topic:TextAndDialogCellEditor
Goto Forum:
  


Current Time: Tue Sep 23 00:33:44 GMT 2014

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

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