[ 
http://issues.apache.org/jira/browse/MYFACES-688?page=comments#action_12331830 
] 

Stefan Betermieux commented on MYFACES-688:
-------------------------------------------

Hi Bill,

sorry, I have never used cactus before, but a simple test would be to add a 
checkbox to the  displayValueOnly.jsp from the simple examples web application. 
E.g. after the checkbox, which toggles the displayValueOnly attribute you could 
put another checkbox:

<h:selectBooleanCheckbox
                id="checkBox2"
                displayValueOnly="#{dvoFace.attribute}"/>
                value="#{dvoFace.attribute}"/>

If you toggle the first checkbox to set the displayValueOnly attribute, the 
second checkbox element causes a ClassCastException.
 

> displayValueOnly property on HtmlSelectBooleanCheckbox throws 
> ClassCastException during rendering, second approach
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-688
>          URL: http://issues.apache.org/jira/browse/MYFACES-688
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.0, Nightly
>  Environment: tomcat 5.5.7, java 1.5, linux 2.6.13
>     Reporter: Stefan Betermieux
>     Assignee: Martin Marinschek
>      Fix For: Nightly

>
> When I create a HtmlSelectBooleanCheckbox and set displayValueOnly to true, 
> an exception is raised during the rendering phase. During encodeEnd() 
> HtmlRendererUtils.renderDisplayValueOnlyForSelects() is called.
> The following snippet causes the problems:
>         
> if (uiComponent instanceof UISelectMany) {
>   isSelectOne = false;
>   selectItemList = RendererUtils.getSelectItemList((UISelectMany) 
> uiComponent);
>   converter = findUISelectManyConverterFailsafe(facesContext, uiComponent);
> } else {
>   isSelectOne = true;
>   selectItemList = RendererUtils.getSelectItemList((UISelectOne) uiComponent);
>   converter = findUIOutputConverterFailSafe(facesContext, uiComponent);
> }
> Since the HtmlSelectBooleanCheckbox is derived neither from UISelectMany nor 
> from UISelectOne but from UISelectBoolean, the cast to UISelectOne fails.

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