For those who still have problem with record/cell validation and all the submitted suggestions doesn't fit, here is a work around:
I assume that this "problem" is not a limitation of the framework but it will be handy if a "forceValidateRow()" or something else could be available in one of the next releases of smartgwt.
Regards,
Cavaleiro.
Code:
private boolean validateRecordRequiredFields(final ListGridRecord record, final List<ListGridField> requiredFields) { int size = requiredFields.size(); for (int i = 0; i < size; ++i) { ListGridField lgf = requiredFields.get(i); String fieldName = lgf.getName(); if (record.getAttribute(fieldName) == null) { Integer recordIdx = lgTable.getRecordIndex(record); lgTable.setEditValue(recordIdx, fieldName, "null"); lgTable.validateCell(recordIdx, fieldName); lgTable.setEditValue(recordIdx, fieldName, ""); lgTable.validateCell(recordIdx, fieldName); return false; } } return true; }
Regards,
Cavaleiro.
Comment