why_vincent
why_vincent

Reputation: 2262

Referencing data in Vaadin Combobox?

I've been having trouble mapping data to a combobox in vaadin. My intention was to have a few comboboxes in a window and a button that the user can press when he is done making selections in the comboboxes.

I want to add a listener to the button, and I know that it is easy to do, but then when the "buttonPressed", or whatever its called, runs I would like it to do something like this(pseudocode):

ComboBox c1;
ComboBox c2;
Button b = new Button(new Button.ClickListener(){
    public void buttonPressed(Event e){
        dostuff(c1.getSelected(), c2.getSelected));
    }
});

Is this possible or am I missing something? Sorry if I sound stupid but I have googled and the examples are to advanced for me and omits stuff that I need to see.

Upvotes: 1

Views: 2491

Answers (1)

Charles Anthony
Charles Anthony

Reputation: 3155

Yes, your pseudo code should work fine; I can't see any problems with what you are doing here. Mind you, you haven't actually said what the problem actually is...

BTW: a ComboBox is called a Select in Vaadin, and getSelected is getValue - i.e. the value of a Select is the selected item.

Upvotes: 1

Related Questions