*/
public static JQGridResult buildJQGridResults(final int rowCount, final int totalPages, final int page,
final TupleTable table) throws TableException
{
final JQGridResult result = new JQGridResult(page, totalPages, rowCount);
for (Iterator<Tuple> it = table.iterator(); it.hasNext();)
{
Tuple row = it.next();
final LinkedHashMap<String, String> rowMap = new LinkedHashMap<String, String>();
for (String fieldName : row.getColNames())
{
String rowValue = !row.isNull(fieldName) ? row.getString(fieldName) : "null";
rowMap.put(fieldName, rowValue); // TODO encode to HTML
}
result.addRow(rowMap);
}
return result;
}