}
@Override
public Dto getData() {
final String[][] fields = moduleDto.getFormFieldIds();
final Dto newDto = moduleDto.createDto();
for (int y = 0; y < fields.length; y++) {
for (int x = 0; x < fields[y].length; x++) {
final String field = fields[y][x];
if (!Dto.isInternalReadOnlyField(field)) {
// TODO this position y, 2*x+1 depends on the current layout of the form..
final Widget widgetValue = table.getWidget(y, 2 * x + 1);
final Serializable value = moduleDto.getFieldById(field).getData(widgetValue);
newDto.set(field, value);
}
}
}
// Copy the id field to allow updates.
newDto.setId(dto.getId());
return newDto;
}