}
@Override
public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) {
VWorksheet vWorksheet = vWorkspace.getViewFactory().getVWorksheetByWorksheetId(worksheetId);
final TablePager pager = vWorksheet.getTablePager(tableId);
final List<Row> additionalRows = pager.loadAdditionalRows();
WorksheetDataUpdate upd = new WorksheetDataUpdate(vWorksheet.getId(), selection);
try {
JSONArray rowsJson = new JSONArray();
if(additionalRows.size() > 0) {
Row row = additionalRows.get(0);
ArrayList<VHNode> nodeList = getNestedNodeList(row, vWorksheet.getHeaderViewNodes());
rowsJson = upd.getRowsJsonArray(additionalRows, vWorksheet,
nodeList,
vWorkspace.getPreferences().getIntViewPreferenceValue(
ViewPreference.maxCharactersInCell));
}
JSONObject responseObj = new JSONObject();
responseObj.put(JsonKeys.tableId.name(), tableId);
responseObj.put(JsonKeys.rows.name(), rowsJson);
responseObj.put(JsonKeys.additionalRowsCount.name(),
pager.getAdditionalRowsLeftCount());
responseObj.put(AbstractUpdate.GenericJsonKeys.updateType.name(),
AdditionalRowsUpdate.class.getSimpleName());
pw.print(responseObj.toString());
} catch (JSONException e) {