* @param jsDataVar
* @throws IOException
*/
protected void encodeData(FacesContext context, Sheet sheet, WidgetBuilder wb) throws IOException {
VarBuilder vbData = new VarBuilder(null, false);
VarBuilder vbStyle = new VarBuilder(null, true);
VarBuilder vbRowStyle = new VarBuilder(null, false);
VarBuilder vbReadOnly = new VarBuilder(null, true);
List<Object> values = sheet.getSortedValues();
int row = 0;
for (Object value : values) {
sheet.setRowIndex(context, row);
encodeRow(context, vbData, vbRowStyle, vbStyle, vbReadOnly, sheet, value, row);
row++;
}
sheet.setRowIndex(context, -1);
wb.nativeAttr("data", vbData.closeVar().toString());
wb.nativeAttr("styles", vbStyle.closeVar().toString());
wb.nativeAttr("rowStyles", vbRowStyle.closeVar().toString());
wb.nativeAttr("readOnly", vbReadOnly.closeVar().toString());
}