Hi there,
version2.4
Programatically editing records of a ListGrid and calling saveAllEdits() after seems to be buggy. When editing manually (click on cell and keyboard edit) it works well, here is the code i use to simulate this user edition :
calling saveAllEdits() after that do not include my programatically edited rows, and return false, event if getAllEditRows() returns a correct value.
Can you please help ?
version2.4
Programatically editing records of a ListGrid and calling saveAllEdits() after seems to be buggy. When editing manually (click on cell and keyboard edit) it works well, here is the code i use to simulate this user edition :
Code:
private void setSelection(ImgButton buttonClicked, String buttonId) {
ListGridRecord[] records = getAcquisitionsGrid().getRecords();
Log.info("Looking for "+buttonId +" in " + records.length + " records");
int idx = -1;
Boolean editing = getAcquisitionsGrid().startEditing();
if (!editing)
Log.error("Not editing for some reason...");
for (ListGridRecord record : records) {
idx++;
if ( record.getAttributeAsString("name").equalsIgnoreCase(buttonId) ){
boolean checked = buttonClicked.isSelected();
Log.debug(record.getAttributeAsString("name") + " equals ? " + buttonId );
Log.debug("edit col "+getAcquisitionsGrid().getEditCol());
getAcquisitionsGrid().setEditValue(idx, selectionProperty, checked);
if (checked)
getAcquisitionsGrid().selectRecord(record);
else
getAcquisitionsGrid().deselectRecord(record);
break;
} else {
continue;
}
}
getAcquisitionsGrid().endEditing();
int[] rows = getAcquisitionsGrid().getAllEditRows();
Log.info("Edited rows : " +rows.length);
}
calling saveAllEdits() after that do not include my programatically edited rows, and return false, event if getAllEditRows() returns a correct value.
Can you please help ?
Comment