I have a c:set variable in Java. I want to +1 to the value in a rich:dataTable, is this possible?
<h:form id="webstoreSettings" styleClass="edit">
<c:set var="_count" value="0" scope="page" />
<rich:panel>
<rich:simpleTogglePanel label="Store Properties"
switchType="client" rendered="true">
<div style="margin: 7px 0px;">
<rich:dataTable id="webListsTable"
value="#{storeHome.webPropertiesVars}" var="_var">
<h:column id="webstoreVarCol">
<h:outputLabel id="webstoreVar_#{_count}" value="#{_var.webstoreVar}" />
<c:set var="_count" value="#{_count + 1}" scope="page" />
</h:column>
</rich:dataTable>
</div>
</rich:simpleTogglePanel>
</rich:panel>
</h:form>
All of the id=”webstoreVar_0″ are the same 🙁
Thanks.
This is not possible. JSTL tags run during view build time, not during view render time. The
<rich:dataTable var>is only available during view render time.I’m not sure why exactly you need a
<h:outputLabel id>like that. It makes no sense. Just remove the EL from theidattribute. JSF will already prepend it with the row index of the data table.See also: