[
https://issues.apache.org/jira/browse/MYFACES-3609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458836#comment-13458836
]
Mike Kienenberger commented on MYFACES-3609:
--------------------------------------------
You can see this posting for possible workarounds.
http://stackoverflow.com/questions/6932034/can-i-specify-a-conditional-rendering-for-an-fselectitem-tag
> rendered attribute of f:selectItem is not evaluated within h:selectOneListbox
> -----------------------------------------------------------------------------
>
> Key: MYFACES-3609
> URL: https://issues.apache.org/jira/browse/MYFACES-3609
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.1.8
> Reporter: Rene O
>
> If you use the rendered attribute of f:selectItem within h:selectOneListBox,
> it is not evaluated. In the example below you can see, that an item with
> rendered-condition false is rendered, which is not the expected behaviour.
> Example:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:ui="http://java.sun.com/jsf/facelets"
> >
> <h:head>
> <title>JSF Test</title>
> </h:head>
> <h:body>
> <h:form id="myForm">
> <h:selectOneListbox id="mySelect" value="none" size="1"
> style="width:100px;">
> <f:selectItem itemValue="A" itemLabel="A" />
> <f:selectItem itemValue="B" itemLabel="B"
> rendered="#{'1' eq '2'}"/>
> </h:selectOneListbox>
>
> <br/>
> output rendered condition selectItem 'B': #{'1' eq '2'}
> <br/>
> you can see, that selectItem is rendered while rendered
> condition is false.
> <br/>
> it looks like, that attribute 'rendered' is not
> evaluated at all.
> </h:form>
> </h:body>
> </html>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira