-
1. Re: how to use iterationStatusVar in datatable
iabughosh Oct 12, 2011 11:01 AM (in response to sathyachand)Dear Sathya,
you need to execute the table to send the current index to your bean, EX :
<rich:dataTable id="userSearchTable"
value="#{yourList}"
var="row"
iterationStatusVar="status">
<h:column>
<f:facet name="header">
<h:outputText value="header"/>
</f:facet>
<a4j:commandLink id="userDeleteLink"
render="@none"
execute="@this"
action="#{yourBean.doSome(#{status.index})}">
</a4j:commandLink>
</h:column>
</rich:dataTable>
your java method :
public void doSome(int rowIndex) {
//etc
}
regards
-
2. Re: how to use iterationStatusVar in datatable
sathyachand Oct 13, 2011 2:24 AM (in response to iabughosh)Thanks Ibrahim.
I think I need to modify the question to explain what is wrong on my side.
Inside datatable tag I used iterationStatusVar="it" and then
my code is like this
<f:facet name="header">
<rich:columnGroup>
<rich:column width="3%">#</rich:column>
<rich:column width="5%">
<h:outputText value="Names" />
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:columnGroup>
<rich:column width="3%"> #{it.index}</rich:column>
<rich:column width="5%">
<h:outputText value="#{bean.name}" />
</rich:column>
</rich:columnGroup>
in the datatable rendered the rows under Names column is having values but the rows under # is empty.