[DataBinding] master-detail binding with non-String properties [message #18440] |
Wed, 01 July 2009 08:44 |
Marcin Gryszko Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hi,
Master-detail binding between TableViewer selection and a Text field
doesn't work for me for non-String properties of the model class.
My TableViewer displays model objects. My model class has a long property,
id, and a String property, description. The description property value is
bound correctly to the corresponding text field, the text field for the id
property remains empty.
I adapted the master-detail snippet from JFace Data Bindin Snippets page:
IObservableValue selection =
ViewersObservables.observeSingleSelection(viewer);
IObservableValue detailObservable =
BeansObservables.observeDetailValue(selection, "id", long.class);
new DataBindingContext().bindValue(SWTObservables.observeText(na me,
SWT.None), detailObservable, new UpdateValueStrategy(false,
UpdateValueStrategy.POLICY_NEVER), null);
Is this behaviour a bug? Should I configure a converter someway? Does
single selection-detail binding work only with java.lang.String properties?
Thanks in advance you for your help,
Marcin Gryszko
|
|
|
|
Powered by
FUDForum. Page generated in 0.03103 seconds