En-desarrollo #27
@ -157,9 +157,21 @@ public class DocumentView extends BeanValidationForm<Document> implements HasUrl
|
||||
UUID documentId = UUID.fromString(s);
|
||||
var document = documentService.getDocument(documentId);
|
||||
setEntityWithEnabledSave(document);
|
||||
|
||||
if ("edit".equals(action) && !s.isEmpty()) {
|
||||
setFieldsReadOnly(false);
|
||||
} else if ("view".equals(action) && !s.isEmpty()) {
|
||||
setFieldsReadOnly(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setFieldsReadOnly(final boolean option) {
|
||||
fileName.setReadOnly(option);
|
||||
documentType.setReadOnly(option);
|
||||
employeeComboBox.setReadOnly(option);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Component> getFormComponents() {
|
||||
return List.of(title, fileName, documentType, employeeComboBox, uploadButton, createCloseButton());
|
||||
|
Loading…
Reference in New Issue
Block a user