Fixed NPE and double rendering of previously focus grid row.
This commit is contained in:
parent
383336a916
commit
cce74efa33
|
@ -451,13 +451,14 @@ public class GridPanel extends Borderlayout implements EventListener
|
||||||
if (!isRowRendered(row, pgIndex)) {
|
if (!isRowRendered(row, pgIndex)) {
|
||||||
listbox.renderRow(row);
|
listbox.renderRow(row);
|
||||||
} else {
|
} else {
|
||||||
Row old = renderer.getCurrentRow();
|
// Row old = renderer.getCurrentRow();
|
||||||
int oldIndex = renderer.getCurrentRowIndex();
|
// int oldIndex = renderer.getCurrentRowIndex();
|
||||||
renderer.setCurrentRow(row);
|
renderer.setCurrentRow(row);
|
||||||
if (old != null && old != row && oldIndex >= 0 && oldIndex != gridTab.getCurrentRow())
|
//remark: following 3 line cause the previously selected row being render twice
|
||||||
{
|
// if (old != null && old != row && oldIndex >= 0 && oldIndex != gridTab.getCurrentRow())
|
||||||
listModel.updateComponent(oldIndex % pageSize);
|
// {
|
||||||
}
|
// listModel.updateComponent(oldIndex % pageSize);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
if (modeless && !renderer.isEditing()) {
|
if (modeless && !renderer.isEditing()) {
|
||||||
renderer.editCurrentRow();
|
renderer.editCurrentRow();
|
||||||
|
@ -475,13 +476,14 @@ public class GridPanel extends Borderlayout implements EventListener
|
||||||
if (!isRowRendered(row, rowIndex)) {
|
if (!isRowRendered(row, rowIndex)) {
|
||||||
listbox.renderRow(row);
|
listbox.renderRow(row);
|
||||||
} else {
|
} else {
|
||||||
Row old = renderer.getCurrentRow();
|
// Row old = renderer.getCurrentRow();
|
||||||
int oldIndex = renderer.getCurrentRowIndex();
|
// int oldIndex = renderer.getCurrentRowIndex();
|
||||||
renderer.setCurrentRow(row);
|
renderer.setCurrentRow(row);
|
||||||
if (old != null && old != row && oldIndex >= 0 && oldIndex != gridTab.getCurrentRow())
|
//remark: following 3 line cause the previously selected row being render twice
|
||||||
{
|
// if (old != null && old != row && oldIndex >= 0 && oldIndex != gridTab.getCurrentRow())
|
||||||
listModel.updateComponent(oldIndex);
|
// {
|
||||||
}
|
// listModel.updateComponent(oldIndex);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
if (modeless && !renderer.isEditing()) {
|
if (modeless && !renderer.isEditing()) {
|
||||||
renderer.editCurrentRow();
|
renderer.editCurrentRow();
|
||||||
|
@ -536,7 +538,7 @@ public class GridPanel extends Borderlayout implements EventListener
|
||||||
if (element instanceof Div) {
|
if (element instanceof Div) {
|
||||||
Div div = (Div) element;
|
Div div = (Div) element;
|
||||||
if (columnOnClick.equals(div.getAttribute("columnName"))) {
|
if (columnOnClick.equals(div.getAttribute("columnName"))) {
|
||||||
cmp = div.getFirstChild().getNextSibling();
|
cmp = div.getFirstChild();
|
||||||
Clients.response(new AuScript(null, "scrollToRow('" + cmp.getUuid() + "');"));
|
Clients.response(new AuScript(null, "scrollToRow('" + cmp.getUuid() + "');"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue