[ 
https://issues.apache.org/jira/browse/MYFACES-251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620445#action_12620445
 ] 

Simon-Pierre Béliveau commented on MYFACES-251:
-----------------------------------------------

I tried it in MyFaces 1.2.2 and I can't reproduce it. It's probably already 
fixed.

> selectManyCheckbox returns conversion error if nothing is selected
> ------------------------------------------------------------------
>
>                 Key: MYFACES-251
>                 URL: https://issues.apache.org/jira/browse/MYFACES-251
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 1.0.9m9
>         Environment: winXP professional SP2
>            Reporter: Dorren Chen
>            Assignee: sean schofield
>
> 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.
-
You can reply to this email to add a comment to the issue online.

Reply via email to