Well, i have a set of Cars that should be in a selectOneMenu. But i have a one SelectItem(null,"ALL").
See my xhtml:
<h:selectOneMenu value="#{mb.carSelected}">
<f:selectItems value="#{mb.cars}" />
<s:convertEntity />
</h:selectOneMenu>
In my managedBean (MB):
private List<SelectItem> cars = new ArrayList<SelectItem>();
...
cars.add(new SelectItem(null, "ALL"));
for (Car c : myCars) {
cars.add(new SelectItem(c, c.getModel()));
}
When i select the "ALL" and click in submit FORM i got the following error:
For input string: "ALL"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
java.lang.Integer.parseInt(Integer.java:449)
java.lang.Integer.<init>(Integer.java:660)
org.jboss.seam.ui.EntityIdentifierStore.get(EntityIdentifierStore.java:46)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
org.jboss.seam.ui.EntityIdentifierStore_$$_javassist_seam_13.get(EntityIdentifierStore_$$_javassist_seam_13.java)
org.jboss.seam.ui.AbstractEntityLoader.get(AbstractEntityLoader.java:27)
org.jboss.seam.ui.EntityConverter.getAsObject(EntityConverter.java:76)
I debug the code and noted that in "EntityConverter.getAsObject" the value passed is "ALL" and occurrs a conversion error. But anothers entity pass the value like 1,2,3 ...