[ http://issues.apache.org/jira/browse/MYFACES-251?page=all ]

Howard Abrams updated MYFACES-251:
----------------------------------

    Fix Version: 1.1.3

> selectManyCheckbox returns conversion error if nothing is selected
> ------------------------------------------------------------------
>
>          Key: MYFACES-251
>          URL: http://issues.apache.org/jira/browse/MYFACES-251
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Versions: 1.0.9m9
>  Environment: winXP professional SP2
>     Reporter: Dorren Chen
>     Assignee: sean schofield
>      Fix For: 1.1.3

>
> 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/[EMAIL 
> PROTECTED]
> 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){
>               // to fix bug that caused "conversion error" when nothing is 
> selected.
>                       return null;
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to