Hi,
I just updated my vaadin version from 4.2.1 to 4.7.2. Peice of code that was working very well before don’t anymore:
public class SearchView extends VerticalLayout {
private DateField filterFrom = new DateField("Date From:");
private DateField filterTo = new DateField("Date To:");
private Button filterBtn = new Button("Filter");
private Button resetBtn = new Button("Reset");
private ComboBox filterCustomer = new ComboBox("Customer:") {
@Override
public String getItemCaption(Object itemId) {
Item item = getItem(itemId);
return String.format("%s", item.getItemProperty("Code").getValue());
}
};
private ComboBox Type = new ComboBox("Type: ") {
@Override
public String getItemCaption(Object itemId) {
Item item = getItem(itemId);
return String.format("%s", item.getItemProperty("Code").getValue());
}
};
private ComboBox Statut = new ComboBox("Status") {
@Override
public String getItemCaption(Object itemId) {
Item item = getItem(itemId);
return String.format("%s", item.getItemProperty("Code").getValue());
}
};
public SearchView() {
filterCustomer.setNullSelectionAllowed(true);
filterCustomer.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS);
filterCustomer.setContainerDataSource(dh.getClient());
filterCustomer.setItemIconPropertyId("Code");
filterCustomer.setImmediate(true);
....
Generate this error:
SEVERE: Servlet.service() for servlet Blackberry_manager_4_2 Application threw exception
java.lang.IllegalArgumentException: Property type must be assignable to Resource
at com.vaadin.ui.AbstractSelect.setItemIconPropertyId(AbstractSelect.java:1301)
at gui.ActionTable$SearchView.<init>(ActionTable.java:532)
at gui.ActionTable.getSearch(ActionTable.java:655)
at com.example.blackberry_manager_4_2.Blackberry_manager_4_2Application.buildActionPane(Blackberry_manager_4_2Application.java:122)
at com.example.blackberry_manager_4_2.Blackberry_manager_4_2Application.buildLayout(Blackberry_manager_4_2Application.java:111)
at gui.Login$1.onLogin(Login.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.LoginForm$2.handleParameters(LoginForm.java:105)
at com.vaadin.ui.Window.handleParameters(Window.java:511)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:528)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
If anyone can help me it would be great becaus right now I’m lost!
Thanks