for (int j = 0; j < cols; j++) {
if (isColumnCollapsed(colids[j])) {
continue;
}
Property p = null;
Object value = "";
boolean isGeneratedRow = generatedRow != null;
boolean isGeneratedColumn = columnGenerators
.containsKey(colids[j]);
boolean isGenerated = isGeneratedRow || isGeneratedColumn;
if (!isGenerated) {
try {
p = getContainerProperty(id, colids[j]);
} catch (Exception e) {
exceptionsDuringCachePopulation.add(e);
value = null;
}
}
if (isGeneratedRow) {
if (generatedRow.isSpanColumns() && j > 0) {
value = null;
} else if (generatedRow.isSpanColumns() && j == 0
&& generatedRow.getValue() instanceof Component) {
value = generatedRow.getValue();
} else if (generatedRow.getText().length > j) {
value = generatedRow.getText()[j];
}
} else {
// check in current pageBuffer already has row
int index = firstIndex + i;
if (p != null || isGenerated) {
int indexInOldBuffer = index - pageBufferFirstIndex;
if (index < firstIndexNotInCache
&& index >= pageBufferFirstIndex
&& pageBuffer[CELL_GENERATED_ROW][indexInOldBuffer] == null
&& id.equals(pageBuffer[CELL_ITEMID][indexInOldBuffer])) {
// we already have data in our cache,
// recycle it instead of fetching it via
// getValue/getPropertyValue
value = pageBuffer[CELL_FIRSTCOL + j][indexInOldBuffer];
if (!isGeneratedColumn && iscomponent[j]
|| !(value instanceof Component)) {
listenProperty(p, oldListenedProperties);
}
} else {
if (isGeneratedColumn) {
ColumnGenerator cg = columnGenerators
.get(colids[j]);
try {
value = cg
.generateCell(this, id, colids[j]);
} catch (Exception e) {
exceptionsDuringCachePopulation.add(e);
value = null;
}
if (value != null
&& !(value instanceof Component)
&& !(value instanceof String)) {
// Avoid errors if a generator returns
// something
// other than a Component or a String
value = value.toString();
}
} else if (iscomponent[j]) {
try {
value = p.getValue();
} catch (Exception e) {
exceptionsDuringCachePopulation.add(e);
value = null;
}