You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Dorren Chen (JIRA)" <my...@incubator.apache.org> on 2005/05/23 16:41:51 UTC

[jira] Created: (MYFACES-251) selectManyCheckbox returns conversion error if nothing is selected

selectManyCheckbox returns conversion error if nothing is selected
------------------------------------------------------------------

         Key: MYFACES-251
         URL: http://issues.apache.org/jira/browse/MYFACES-251
     Project: MyFaces
        Type: Bug
    Versions: 1.0.9 beta    
 Environment: winXP professional SP2
    Reporter: Dorren Chen


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){
        	// 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


[jira] Commented: (MYFACES-251) selectManyCheckbox returns conversion error if nothing is selected

Posted by "Simon-Pierre Béliveau (JIRA)" <de...@myfaces.apache.org>.
    [ 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/%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){
>         	// 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.


[jira] Updated: (MYFACES-251) selectManyCheckbox returns conversion error if nothing is selected

Posted by "Howard Abrams (JIRA)" <de...@myfaces.apache.org>.
     [ 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/%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){
>         	// 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


[jira] Updated: (MYFACES-251) selectManyCheckbox returns conversion error if nothing is selected

Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-251?page=all ]

sean schofield updated MYFACES-251:
-----------------------------------

      Component: JSF 1.1
    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){
        	// to fix bug that caused "conversion error" when nothing is selected.
        		return null;
        }


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



> 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: JSF 1.1
>     Versions: 1.0.9 beta
>  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/%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){
>         	// 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