Hi,
I am having a strange error with 6.3.0.
I have a simple form along the lines of:
form.getLayout().setMargin(true);
// Add some components
form.setImmediate(true);
Select select = new Select("Some caption");
select.setInvalidAllowed(false);
select.setNullSelectionAllowed(false);
select.addItem("GBP");
select.addItem("EUR");
select.addItem("USD");
form.addField("test",select);
When I select an item I get this error on the server:
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
at com.vaadin.ui.Select.changeVariables(Select.java:373)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1087)
it looks like the variable that is coming back from the server and mapped in the VariableRecord in AbstractCommunicationManager is similar to: select/PIDXX/a
so the select is mapping ‘a’ to an Object rather than a String
when converting the selection. I am expecting that the select mapped type should be a String or a String type but it always seems to be an Object
.
I have also tried using both IndexedContainer along the lines of:
IndexedContainer container = new IndexedContainer();
container.addItem(“GBP”);
container.addItem(“EUR”);
container.addItem(“USD”);
ComboBox combo = new ComboBox(“Currency”, container);
but I still get the same issue.
I am probably doing something stupid - but any help would be appreciated?