-
1. Re: Cannot retrieve row index in ExtendedTableDataModel
pvito Feb 16, 2012 2:23 AM (in response to kang2012)Hi, KA NG
Try use iterationStatusVar attribute to retrive row index:
<h:form>
<rich:dataScroller for="table" maxPages="5" />
<rich:extendedDataTable value="#{myBeen.list}" var="v" iterationStatusVar="isv" id="table" rows="5">
<rich:column>
<f:facet name="header">0</f:facet>
#{isv.index}
</rich:column>
<rich:column>
<f:facet name="header">1</f:facet>
#{v.value1}
</rich:column>
<rich:column>
<f:facet name="header">2</f:facet>
#{v.value2}
</rich:column>
</rich:extendedDataTable>
</h:form>
Regards, Vitaliy
-
2. Re: Cannot retrieve row index in ExtendedTableDataModel
kang2012 Feb 16, 2012 3:19 PM (in response to pvito)Hi Vitaliy,
Thanks for your reply. IterationStatusVar only works for dataTable, not extendedDataTable. Also, this would be helpful for displaying the index in the table. I need the indexes of the backing extendedTableDataModel, so that I'll get the correct index of a particular rowKey when the order of the table changes. I need to know where a particular row will end up in the table after sorting using Asc/Desc arrows.
-
3. Re: Cannot retrieve row index in ExtendedTableDataModel
lobo369 Feb 17, 2012 4:00 PM (in response to kang2012)Hi KA NG
If you want to retrieve the row index of the selected row you need to set binding parameter of the ExtendedDataTable to a variable of type javax.faces.component.UIData.
Then in your action you use UIData to retrive the row [getRowData()] or the index [getRowIndex()].