This content has been marked as final.
Show 4 replies
-
1. Re: DataTable RowKeyVar problem
nbelaevski Oct 14, 2009 2:55 PM (in response to gizola)Hi Gizola,
Model generates row keys in walk(...) method. You can override it to generate sequential keys for rows. -
2. Re: DataTable RowKeyVar problem
gizola Oct 15, 2009 3:23 AM (in response to gizola)Hi!
Thanks for the answer. Now this is my walk method:@Override public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException { final SequenceRange seqRange = (SequenceRange) range; int rows = seqRange.getRows(); int rowCount = getRowCount(); int currentRow = seqRange.getFirstRow(); if (rows > 0) { rows += currentRow; rows = Math.min(rows, rowCount); } else { rows = rowCount; } for (; currentRow < rows; currentRow++) { visitor.process(context, rowKeys.get(currentRow), argument); } }
The currentRow variable contains the sequential key, but I have to get the apropriate rowKey from the rowKeys to display correct row in the datatable. How to implement here a sequential row key when the rowKeys are mixed in my rowKeys variable (according to sorting and filtering)?
Thank you for helping.
Regards,
Gizola -
3. Re: DataTable RowKeyVar problem
gizola Oct 16, 2009 3:37 AM (in response to gizola)
Well I finally solved the problem. I had to override getRowKey and setRowKey methods also (or at least make small changes in them).
Not it is working.
Thanks for the hint.
Regards,
Gizola -
4. Re: DataTable RowKeyVar problem
gizola Oct 16, 2009 4:20 AM (in response to gizola)"Not it is working" was of course mistyped :)
Now it is working is the right sentense.
Regards,
Gizola