I added radio button tags to the following JSP (abridged and anonymized) in a JSF application. It does not render any radio buttons, nor does it call any of the relevant methods in the managed bean.
<h:form id="orderForm">
<t:selectOneRadio
id="theRadioInput"
layout="spread"
forceId="true"
forceIdIndex="false"
value="#{bean.aStringProperty}"
styleClass="field">
<f:selectItems value="#{bean.radioSelectItems}"/>
<a4j:support
event="onclick"
reRender="theRadioInput"
actionListener="#{bean.listener}"/>
</t:selectOneRadio>
<rich:dataTable
id="dataTable"
value="#{bean.listOfDataObjects}"
var="curDataObject"
rowKeyVar="index">
<rich:column style="border-left">
<rich:panel style="border:none">
...
</rich:panel>
</rich:column>
<rich:column>
<h:outputText value="#{curDataObject.location}" styleClass="label" style="font-size:12;"/>
<rich:dataList var="item" value="#{curDataObject.someItems}" rowKeyVar="itemIndex" styleClass="noWrap">
<h:outputText value="Some data:" styleClass="label" />
<h:outputText value="#{item}" styleClass="label" />
</rich:dataList>
<t:radio for=":orderForm:theRadioInput" index="#{index}" rendered="curDataObject.radioApplicable"/>
</rich:column>
</rich:dataTable>
</h:form>
I wonder, does the fact that I'm using <rich:dataTable>
, not <t:dataTable>
make a difference? What else could prevent the radio buttons from appearing at all? Not even bean.getRadioSelectItems()
gets called during rendering. (It does get called later, when the page is submitted.)
If you insist, maybe I'll post the relevant code from the managed bean, but I don't think that's the issue, since it's not even getting called.
The "real" version of this page works and has been in a production application for several years. The addition of radio buttons is the only change.
The first thing that jumps to mind here is that the rendered
attribute of the radio button is attempting to evaluate a string. It looks like you intended it to be an EL expression, but left out the braces.