I have a comboviewer, and i need to have the databinding on it, so that the combo selection is automatically updated in the Model.
Also i need to add the combo items dynamically (to the exisitng combo items). With databinding how can i acheive this?
As am new to databinding, please point me to some good tutorial on comboviewer databinding with dynamic items (combo items).
The below code is for binding the comboviewer selection to the model:
final IObservableValue entityComboObservable = ViewersObservables.
observeSingleSelection(myComboViewer);
final IObservableValue modelSelectedEntityObservable = BeansObservables.
observeValue (cmpObj, Company.EMP_SELCTION);
bindingCntxt.bindValue(modelSelectedEntityObservable, entityComboObservable);
where "cmpObj" is my model object which contains the list of objects which will be set as the input to the comboviewer
You can do something like
Now create a model-ovservable and bind it with
swtObs