Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Databinding ListViewer(Based on combo selection listviewer should be undated with list values)
Databinding ListViewer [message #1804145] Tue, 19 March 2019 09:48 Go to next message
VJ M is currently offline VJ MFriend
Messages: 3
Registered: March 2019
Junior Member
Hi Team,

This is my first question in this forum. I have been trying to create data binding between Combo viewer and List Viewer. My query is
If I select a values in the Combo Viewer I need to update a list of values in the ListViewer. Listviewer values has to be changed based on combo selection. All values are of type String

Please check my code I have written

//Dialog Code
//Assume I created a contentcomposite already

ComboViewer comboViewer = new ComboViewer(parent, SWT.READ_ONLY);        comboViewer.setContentProvider(ArrayContentProvider.getInstance());
comboViewer.setLabelProvider(new LabelProvider());       
comboViewer.setInput(importModel.getcViewerList()); //will get values for combo viewer

ListViewer listViewer = new ListViewer(parent);
 listViewer.setContentProvider(ArrayContentProvider.getInstance());
 listViewer.setLabelProvider(new LabelProvider());


//Model Class

public class TestModel {

    private Collection<String> testList = new ArrayList<>();

    private String testValue1;

    public Collection<String> gettestList() {
        return testList;
    }

    public void settestList(Collection<String> teslist) {
        this.vehicleClassesList = teslist;
    }
}


I tried to bind the values using Databinding Contex but I am unable to get the result I am new to java and databinding I read few tutorials to get it done. I need some help on this please suggest how we can use databinding on this.


Thanks in advance.
VJM
Re: Databinding ListViewer [message #1804508 is a reply to message #1804145] Wed, 27 March 2019 15:23 Go to previous message
VJ M is currently offline VJ MFriend
Messages: 3
Registered: March 2019
Junior Member
Is there anyone to respond
Previous Topic:Unable to merge files in a C++ synchronized project.
Next Topic:Eclipse programs don't work after JDK 12
Goto Forum:
  


Current Time: Thu Apr 25 22:06:01 GMT 2024

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

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

Back to the top