Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
2 changed files:
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/seine/ObjectMaterialUIHandler.java
- dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java
Changes:
| ... | ... | @@ -28,7 +28,6 @@ import fr.ird.observe.dto.referential.seine.ObjectMaterialDto; |
| 28 | 28 |
import fr.ird.observe.dto.referential.seine.ObjectMaterialReference;
|
| 29 | 29 |
import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 30 | 30 |
|
| 31 |
-import java.util.Collections;
|
|
| 32 | 31 |
import java.util.List;
|
| 33 | 32 |
import java.util.Objects;
|
| 34 | 33 |
import java.util.Optional;
|
| ... | ... | @@ -46,6 +45,16 @@ class ObjectMaterialUIHandler extends ContentReferenceUIHandler<ObjectMaterialDt |
| 46 | 45 |
@Override
|
| 47 | 46 |
public void createUI() {
|
| 48 | 47 |
super.createUI();
|
| 48 |
+ setParentList();
|
|
| 49 |
+ }
|
|
| 50 |
+ |
|
| 51 |
+ @Override
|
|
| 52 |
+ public void modifyUI() {
|
|
| 53 |
+ super.modifyUI();
|
|
| 54 |
+ setParentList();
|
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+ private void setParentList() {
|
|
| 49 | 58 |
Optional<Set<ObjectMaterialReference>> optionalReferenceSetDto = getModel().tryToGetReferentialReferenceSet(ObjectMaterialDto.PROPERTY_PARENT);
|
| 50 | 59 |
|
| 51 | 60 |
if (optionalReferenceSetDto.isPresent()) {
|
| ... | ... | @@ -56,16 +65,4 @@ class ObjectMaterialUIHandler extends ContentReferenceUIHandler<ObjectMaterialDt |
| 56 | 65 |
}
|
| 57 | 66 |
}
|
| 58 | 67 |
|
| 59 |
- @Override
|
|
| 60 |
- public void modifyUI() {
|
|
| 61 |
- super.modifyUI();
|
|
| 62 |
- ObjectMaterialReference parent = getBean().getParent();
|
|
| 63 |
- if (parent == null) {
|
|
| 64 |
- |
|
| 65 |
- getUi().getParentCode().setData(Collections.emptyList());
|
|
| 66 |
- } else {
|
|
| 67 |
- getUi().getParentCode().setData(Collections.singletonList(parent));
|
|
| 68 |
- }
|
|
| 69 |
- }
|
|
| 70 |
- |
|
| 71 | 68 |
}
|
| ... | ... | @@ -22,6 +22,7 @@ package fr.ird.observe.dto.referential.seine; |
| 22 | 22 |
* #L%
|
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 |
+import fr.ird.observe.dto.referential.FormulaHelper;
|
|
| 25 | 26 |
import org.apache.commons.lang3.StringUtils;
|
| 26 | 27 |
|
| 27 | 28 |
public class ObjectMaterialDto extends GeneratedObjectMaterialDto {
|
| ... | ... | @@ -44,6 +45,13 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto { |
| 44 | 45 |
return objectMaterialType != null && "fr.ird.observe.entities.referentiel.seine.ObjectMaterialType#0#1".equals(objectMaterialType.getId());
|
| 45 | 46 |
}
|
| 46 | 47 |
|
| 48 |
+ @Override
|
|
| 49 |
+ public void setValidation(String validation) {
|
|
| 50 |
+ super.setValidation(validation);
|
|
| 51 |
+ boolean result = FormulaHelper.validateObjectMaterialValidation(validation, 10);
|
|
| 52 |
+ setValidationValid(result);
|
|
| 53 |
+ }
|
|
| 54 |
+ |
|
| 47 | 55 |
public boolean withValidation() {
|
| 48 | 56 |
return StringUtils.isNoneEmpty(validation);
|
| 49 | 57 |
}
|