Hi Etienne,
You are half right :-)
- ULCTable.getColumnClass() expects the view index, not the model index,
i.e. my original code is correct
- Columns are referenced by proxy id, not by view index, i.e. my
original code is buggy
The correct code is now
ULCTableColumn column = table.getColumnModel().getColumn(i);
if (column.getCellRenderer() != null
|| table.getDefaultRenderer(table.getColumnClass(i))
!= null) {
tmpResult[tmpCount] = *column.getId()*;* // used to be 'i'*
tmpCount++;
}
I will correct the contribution in the next days. Thanx for your
detailed feedback!
Regards Dany
Etienne Studer wrote:
Hi ULC Team & Daniel (Grob)
When running against ULC 6.0.4, the EagerLoadingHandler community
contribution has 2 bugs, triggering exceptions at startup time in our
application.
Correct would be:
private static int[]
getRendererColumns()/getEditorColumns()/getHeaderColumns() {
int[] tmpResult = new int[table.getColumnCount()];
int tmpCount = 0;
for (int i = 0; i < table.getColumnCount(); i++) {
ULCTableColumn column = table.getColumnModel().getColumn(i);
if (column.getCellEditor() != null ||
table.getDefaultEditor(table.getColumnClass(*column.getModelIndex()*))
!= null) { *// used to be i*
* *tmpResult[tmpCount] =*
table.getColumnModel().getColumn(i).getId(); // used to be i;*
tmpCount++;
}
}
int[] result = new int[tmpCount];
System.arraycopy(tmpResult, 0, result, 0, result.length);
return result;
}
Just to let you (and other developers) know.
Thanks for the contribution.
Regards, Etienne
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer