This page (revision-6) was last changed on 17-Dec-2010 13:24 by Dieter Käppel

This page was created on 22-Oct-2010 16:11 by Dieter Käppel

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
6 17-Dec-2010 13:24 3 KB Dieter Käppel to previous
5 17-Dec-2010 13:24 3 KB Dieter Käppel to previous | to last
4 16-Dec-2010 16:50 3 KB Dieter Käppel to previous | to last
3 04-Nov-2010 16:02 3 KB Dieter Käppel to previous | to last
2 02-Nov-2010 18:43 1 KB Dieter Käppel to previous | to last
1 22-Oct-2010 16:11 630 bytes Dieter Käppel to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 54 added 70 lines
!Paging DataModel für DataTable
{{{
public class PageableDataModel extends SerializableDataModel {
private Long rowKey;
@Override
public Long getRowKey() {
return rowKey;
}
@Override
public void setRowKey(Object key) {
this.rowKey = (Long)key;
}
@Override
public int getRowIndex() {
return 0;
}
@Override
public void setRowIndex(int rowIndex) {
}
@Override
public Object getWrappedData() {
throw new UnsupportedOperationException();
}
@Override
public void setWrappedData(Object data) {
throw new UnsupportedOperationException();
}
@Override
public int getRowCount() {
return backend.size();
}
@Override
public Object getRowData() {
if (rowKey == null)
return null;
return backend.get(rowKey);
}
@Override
public boolean isRowAvailable() {
return backend.containsKey(rowKey);
}
@Override
public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException {
SequenceRange sequenceRange = (SequenceRange)range;
int firstRow = sequenceRange.getFirstRow();
int toIndex = sequenceRange.getFirstRow() + sequenceRange.getRows();
for (int index = firstRow; index < toIndex; ++index) {
Data data = backend.get(index);
visitos.process(context, data.getKey(), argument);
}
}
@Override
public void update() {
}
@Override
public SerializableDataModel getSerializableModel(Range range) {
return this;
}
}
}}}