ComboBox setValue() without effect / getValue() returns nullpointer

Hi!

I’ve a ComboBox bound to a SQLContainer. It is filled correctly, so that I can see the items. Also, when I log getItemIds() I see the correct item ids.

But, when I manually set a value, the ComboBox still don’t select the proper item. When I do getValue().toString() to log the selected value, I get a NullPointerException. Because I’m not certain which type the item ids are of, I’ve tried integer and strings, but no success.

I’m quite new to Java and Vaadin, so I’ve got no clou on what I’m doing wrong here. Any hints or ideas?

Thanks in advance,

Michael

Did you already try combobox.select()?

Also do you have nullitemsallowed set to true?

Regards,
M.R.

Yes, I’ve tried select() instead of setValue(). And setNullSelectionAllowed(false).

This is confusing.

Foo.setValue(new RowId(new Object {item.getItemProperty(“Foo”).getValue()}));

This one sets the ComboBox to the correct value. I had to call this during form initialization. But there must be something to get values of type RowId from the SQLContainer then, doesn’t it? Btw. ‘item’ is passed from a double click event of a table.