|Re: TableViewer, DataBindingContext and UpdateValueStrategy [message #830422 is a reply to message #816075]
||Tue, 27 March 2012 15:52
| Mark Hoffmann
Registered: July 2009
Agnes Thanbichler wrote on Thu, 08 March 2012 12:52|
is there a possibility to perfom databinding on a table by using the DatabindingContext and UpdateValueStrategy?
The following points would be useful also on the table/table contents
1. Restrict updates on a table (UpdateValueStrategy.POLICY_ON_REQUEST)
2. Use converters
3. Use validators (for editing)
With ViewerSupport, I could bind my emf object to the table. However, I cannot find a way of using a (EMF)DataBindingContext like I already did with other controls.
Thanks for any help!
you can use the TableViewer for your tables. Then you have ObservableListContentProvider and ObservableMapLabelProvider.
For this you need no DataBindingContext. As input for the table you usually set an IObservableList/IObservableSet.
For point 1 you can bind you model to a WritableList using DataBindingContext#bindList using an UpdateListStrategy. You can set a converter to the UpdateListStrategy.
If you need a validator you have to use master details binding, because you want to edit a certain field in your list of objects. There is an ObservableValueEditingSupport to bring databinding into an editable table viewer.
Look at the snippets at the link below for master details binding and viewers binding with editing support.
Powered by FUDForum
. Page generated in 0.01509 seconds