Ticket #1163 (closed issue: fixed)
Table column reordering
| Reported by: | Henri Kerola | Owned by: | Jani Laakso |
|---|---|---|---|
| Priority: | undefined | Milestone: | 4.0.4-rc4 |
| Component: | undefined | Version: | 4.0.4 |
| Keywords: | Cc: | ||
| Known Issue description: | |||
| Hours estimate: | Deadline (dd.mm.yyyy): | 22.11.2007 | |
| Known Issue version (since): | Known Issue title: | ||
| Hours done: | Depends to: | ||
| Affects documentation: | no | ||
| Known Issue workaround: | |||
| Affects release notes: | yes | Contract: | |
Description
Reordering table's columns by drag-and-drop fails when Column property id is not a String.
Problem is in Table's changeVariables method (line 1354) which throws java.lang.ArrayStoreException?:
if (this.isColumnReorderingAllowed()) {
if (variables.containsKey("columnorder")) {
try {
Object[] ids = (Object[]) variables.get("columnorder");
for (int i = 0; i < ids.length; i++) {
ids[i] = columnIdMap.get(ids[i].toString()); // Throws java.lang.ArrayStoreException
}
this.setColumnOrder(ids);
} catch (Exception ignored) {
}
}
}
For example the following code fixes the problem:
if (this.isColumnReorderingAllowed()) {
if (variables.containsKey("columnorder")) {
try {
Object[] ids = (Object[]) variables.get("columnorder");
LinkedList newVC = new LinkedList();
for (int i = 0; i < ids.length; i++) {
//ids[i] = columnIdMap.get(ids[i].toString());
newVC.add(columnIdMap.get(ids[i].toString()));
}
//this.setColumnOrder(ids);
this.setColumnOrder(newVC.toArray());
} catch (Exception ignored) {
}
}
}
Change History
Note: See
TracTickets for help on using
tickets.
