Details
Description
when I use <h:selectManyCheckbox> with a few checkboxes, it works correctly if I select at least one item from the checkboxes. However, if I don't select anything and submit the form, myfaces always gives "conversion error" in the context message <h:messages>, no exception stacktrace or log trace.
I found another user has the same problem http://mail-archives.apache.org/mod_mbox/myfaces-users/200505.mbox/%3cd05cabe70505060731604585d0@mail.gmail.com%3e
I'm using myfaces version 1.0.9, build on (2005-04-13 13:17 EDT)
after I digging around for awhile, I found out that myfaces only checks either null or String[] types, but in fact, an empty selection returns "", a zero length string. It works correct after I made changes to src/share/org.apache.myfaces.renderkit.RendererUtils.java's public static Object getConvertedUISelectManyValue() method, and add zero length string check between null and String[] check, as shown below:
else if (submittedValue instanceof String &&
((String)submittedValue).length() == 0)