You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Craig McClanahan (JIRA)" <de...@myfaces.apache.org> on 2005/11/16 03:54:29 UTC

[jira] Created: (MYFACES-829) with value bound to an array of int fails

<h:selectManyCheckbox> with value bound to an array of int fails
----------------------------------------------------------------

         Key: MYFACES-829
         URL: http://issues.apache.org/jira/browse/MYFACES-829
     Project: MyFaces
        Type: Bug
  Components: Implementation  
    Versions: 1.1.0    
 Environment: Linux, JDK 1.5.0_05
    Reporter: Craig McClanahan


The Shale "use cases" example includes a page where an <h:selectManyCheckbox> component is bound to an array of int that represents selected values.  A bug was reported against this app:

    http://issues/apache.org/bugzilla/show_bug.cgi?id=37361

However, further investigation shows that this case works correctly with the JSF RI, leading to the belief that it represents an implementation error in MyFaces.  See the above bug report for more details.

For reference, the page includes the following component:

    <h:selectManyCheckbox id="categories" layout="pageDirection"
     value="#{dialog.data.categories}">
        <h:selectItems value="#{domains.supportedCategories}"/>
    </h:selectManyCheckbox>

where the binding expressions point at values of the following types:

* #{dialog.data.categories} points at an array of int representing
  the currently selected categories

* #{domains.supportedCategories} points at an array of SelectItem,
  where the "value" property of each is an Integer representing the
  primary key for that category.


-- 
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-829) with value bound to an array of int fails

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-829?page=comments#action_12357930 ] 

sean schofield commented on MYFACES-829:
----------------------------------------

This is definitely a MyFaces implementation bug.  The validateValue method in UISelectMany assumes the converted values to be an instanceof Object[] or List.  A primitive array automatically causes a validation error (without even checking the values.)  The RI uses a custom iterrator (SelectItemsIterator).  That might be a better approach then the current "if .. else" approach we have (now that we know there are more then two cases.)

> <h:selectManyCheckbox> with value bound to an array of int fails
> ----------------------------------------------------------------
>
>          Key: MYFACES-829
>          URL: http://issues.apache.org/jira/browse/MYFACES-829
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Versions: 1.1.0
>  Environment: Linux, JDK 1.5.0_05
>     Reporter: Craig McClanahan
>     Assignee: sean schofield

>
> The Shale "use cases" example includes a page where an <h:selectManyCheckbox> component is bound to an array of int that represents selected values.  A bug was reported against this app:
>     http://issues/apache.org/bugzilla/show_bug.cgi?id=37361
> However, further investigation shows that this case works correctly with the JSF RI, leading to the belief that it represents an implementation error in MyFaces.  See the above bug report for more details.
> For reference, the page includes the following component:
>     <h:selectManyCheckbox id="categories" layout="pageDirection"
>      value="#{dialog.data.categories}">
>         <h:selectItems value="#{domains.supportedCategories}"/>
>     </h:selectManyCheckbox>
> where the binding expressions point at values of the following types:
> * #{dialog.data.categories} points at an array of int representing
>   the currently selected categories
> * #{domains.supportedCategories} points at an array of SelectItem,
>   where the "value" property of each is an Integer representing the
>   primary key for that category.

-- 
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-829) with value bound to an array of int fails

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

sean schofield updated MYFACES-829:
-----------------------------------

    Component: JSR-127
                   (was: Implementation)
     Priority: Critical  (was: Major)

Upgrading severity since this is a JSF 1.1 compliance issue.  The javadoc for UISelectMany clearly states that an array of primitives is to be supported.

> <h:selectManyCheckbox> with value bound to an array of int fails
> ----------------------------------------------------------------
>
>          Key: MYFACES-829
>          URL: http://issues.apache.org/jira/browse/MYFACES-829
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: 1.1.0
>  Environment: Linux, JDK 1.5.0_05
>     Reporter: Craig McClanahan
>     Assignee: sean schofield
>     Priority: Critical

>
> The Shale "use cases" example includes a page where an <h:selectManyCheckbox> component is bound to an array of int that represents selected values.  A bug was reported against this app:
>     http://issues/apache.org/bugzilla/show_bug.cgi?id=37361
> However, further investigation shows that this case works correctly with the JSF RI, leading to the belief that it represents an implementation error in MyFaces.  See the above bug report for more details.
> For reference, the page includes the following component:
>     <h:selectManyCheckbox id="categories" layout="pageDirection"
>      value="#{dialog.data.categories}">
>         <h:selectItems value="#{domains.supportedCategories}"/>
>     </h:selectManyCheckbox>
> where the binding expressions point at values of the following types:
> * #{dialog.data.categories} points at an array of int representing
>   the currently selected categories
> * #{domains.supportedCategories} points at an array of SelectItem,
>   where the "value" property of each is an Integer representing the
>   primary key for that category.

-- 
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-829) with value bound to an array of int fails

Posted by "John R. Fallows (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-829?page=all ]

John R. Fallows updated MYFACES-829:
------------------------------------

    Attachment: myfaces-829-post-reorg.patch

Reworked the patch for post-reorg maven2 build.

Introduced a "xx_TEST" locale to serve up javax.faces.Messages bundle messages during unit testing.

> <h:selectManyCheckbox> with value bound to an array of int fails
> ----------------------------------------------------------------
>
>          Key: MYFACES-829
>          URL: http://issues.apache.org/jira/browse/MYFACES-829
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: 1.1.0
>  Environment: Linux, JDK 1.5.0_05
>     Reporter: Craig McClanahan
>     Assignee: sean schofield
>     Priority: Critical
>      Fix For: 1.1.2
>  Attachments: myfaces-829-post-reorg.patch, myfaces-829.patch
>
> The Shale "use cases" example includes a page where an <h:selectManyCheckbox> component is bound to an array of int that represents selected values.  A bug was reported against this app:
>     http://issues/apache.org/bugzilla/show_bug.cgi?id=37361
> However, further investigation shows that this case works correctly with the JSF RI, leading to the belief that it represents an implementation error in MyFaces.  See the above bug report for more details.
> For reference, the page includes the following component:
>     <h:selectManyCheckbox id="categories" layout="pageDirection"
>      value="#{dialog.data.categories}">
>         <h:selectItems value="#{domains.supportedCategories}"/>
>     </h:selectManyCheckbox>
> where the binding expressions point at values of the following types:
> * #{dialog.data.categories} points at an array of int representing
>   the currently selected categories
> * #{domains.supportedCategories} points at an array of SelectItem,
>   where the "value" property of each is an Integer representing the
>   primary key for that category.

-- 
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-829) with value bound to an array of int fails

Posted by "John R. Fallows (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-829?page=all ]

John R. Fallows updated MYFACES-829:
------------------------------------

    Attachment: myfaces-829.patch

Ensure that a value of type primitive array is validated correctly against the select items.

UISelectManyTest verifies the correctness of the logic in UISelectMany.validateValue, such as enforcing required, type support for iterating over selected item values, and making sure that the selected values are all in the set of available select item values.  When executed against the original code for UISelectMany, this test case passed all tests except primitive int arrays.  Now all the tests pass.

This patch was created against https://svn.apache.org/repos/asf/myfaces/current, revision 359829.

> <h:selectManyCheckbox> with value bound to an array of int fails
> ----------------------------------------------------------------
>
>          Key: MYFACES-829
>          URL: http://issues.apache.org/jira/browse/MYFACES-829
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: 1.1.0
>  Environment: Linux, JDK 1.5.0_05
>     Reporter: Craig McClanahan
>     Assignee: sean schofield
>     Priority: Critical
>      Fix For: 1.1.2
>  Attachments: myfaces-829.patch
>
> The Shale "use cases" example includes a page where an <h:selectManyCheckbox> component is bound to an array of int that represents selected values.  A bug was reported against this app:
>     http://issues/apache.org/bugzilla/show_bug.cgi?id=37361
> However, further investigation shows that this case works correctly with the JSF RI, leading to the belief that it represents an implementation error in MyFaces.  See the above bug report for more details.
> For reference, the page includes the following component:
>     <h:selectManyCheckbox id="categories" layout="pageDirection"
>      value="#{dialog.data.categories}">
>         <h:selectItems value="#{domains.supportedCategories}"/>
>     </h:selectManyCheckbox>
> where the binding expressions point at values of the following types:
> * #{dialog.data.categories} points at an array of int representing
>   the currently selected categories
> * #{domains.supportedCategories} points at an array of SelectItem,
>   where the "value" property of each is an Integer representing the
>   primary key for that category.

-- 
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] Closed: (MYFACES-829) with value bound to an array of int fails

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

    Fix Version: Nightly
     Resolution: Fixed

Patch was applied.  NOTE: ASF licenses were added to some files and I moved the mock stuff to a new package 'org.apache.myfaces.mock'.

> <h:selectManyCheckbox> with value bound to an array of int fails
> ----------------------------------------------------------------
>
>          Key: MYFACES-829
>          URL: http://issues.apache.org/jira/browse/MYFACES-829
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: 1.1.0
>  Environment: Linux, JDK 1.5.0_05
>     Reporter: Craig McClanahan
>     Assignee: sean schofield
>     Priority: Critical
>      Fix For: 1.1.2, Nightly
>  Attachments: myfaces-829-post-reorg.patch, myfaces-829.patch
>
> The Shale "use cases" example includes a page where an <h:selectManyCheckbox> component is bound to an array of int that represents selected values.  A bug was reported against this app:
>     http://issues/apache.org/bugzilla/show_bug.cgi?id=37361
> However, further investigation shows that this case works correctly with the JSF RI, leading to the belief that it represents an implementation error in MyFaces.  See the above bug report for more details.
> For reference, the page includes the following component:
>     <h:selectManyCheckbox id="categories" layout="pageDirection"
>      value="#{dialog.data.categories}">
>         <h:selectItems value="#{domains.supportedCategories}"/>
>     </h:selectManyCheckbox>
> where the binding expressions point at values of the following types:
> * #{dialog.data.categories} points at an array of int representing
>   the currently selected categories
> * #{domains.supportedCategories} points at an array of SelectItem,
>   where the "value" property of each is an Integer representing the
>   primary key for that category.

-- 
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-829) with value bound to an array of int fails

Posted by "Howard Abrams (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-829?page=all ]

Howard Abrams updated MYFACES-829:
----------------------------------

    Fix Version: Nightly

> <h:selectManyCheckbox> with value bound to an array of int fails
> ----------------------------------------------------------------
>
>          Key: MYFACES-829
>          URL: http://issues.apache.org/jira/browse/MYFACES-829
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: 1.1.0
>  Environment: Linux, JDK 1.5.0_05
>     Reporter: Craig McClanahan
>     Assignee: sean schofield
>     Priority: Critical
>      Fix For: Nightly

>
> The Shale "use cases" example includes a page where an <h:selectManyCheckbox> component is bound to an array of int that represents selected values.  A bug was reported against this app:
>     http://issues/apache.org/bugzilla/show_bug.cgi?id=37361
> However, further investigation shows that this case works correctly with the JSF RI, leading to the belief that it represents an implementation error in MyFaces.  See the above bug report for more details.
> For reference, the page includes the following component:
>     <h:selectManyCheckbox id="categories" layout="pageDirection"
>      value="#{dialog.data.categories}">
>         <h:selectItems value="#{domains.supportedCategories}"/>
>     </h:selectManyCheckbox>
> where the binding expressions point at values of the following types:
> * #{dialog.data.categories} points at an array of int representing
>   the currently selected categories
> * #{domains.supportedCategories} points at an array of SelectItem,
>   where the "value" property of each is an Integer representing the
>   primary key for that category.

-- 
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