| ... |
... |
@@ -49,8 +49,8 @@ import fr.ird.observe.dto.result.SaveResultDto; |
|
49
|
49
|
import fr.ird.observe.services.service.actions.consolidate.dcp.ConsolidateFloatingObjectRequest;
|
|
50
|
50
|
import fr.ird.observe.services.service.actions.consolidate.dcp.ConsolidateFloatingObjectResult;
|
|
51
|
51
|
import fr.ird.observe.spi.DtoModelHelper;
|
|
52
|
|
-import org.apache.logging.log4j.Logger;
|
|
53
|
52
|
import org.apache.logging.log4j.LogManager;
|
|
|
53
|
+import org.apache.logging.log4j.Logger;
|
|
54
|
54
|
import org.nuiton.jaxx.runtime.spi.UIHandler;
|
|
55
|
55
|
import org.nuiton.jaxx.runtime.swing.SwingUtil;
|
|
56
|
56
|
import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
|
| ... |
... |
@@ -147,6 +147,8 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto, |
|
147
|
147
|
Set<FloatingObjectPartReference> partsSet;
|
|
148
|
148
|
Form<FloatingObjectDto> form;
|
|
149
|
149
|
Optional<FloatingObjectPreset> floatingObjectReference;
|
|
|
150
|
+ boolean useReference = false;
|
|
|
151
|
+
|
|
150
|
152
|
if (dcpId == null) {
|
|
151
|
153
|
|
|
152
|
154
|
Optional<FloatingObjectPreset> ref = ObserveSwingApplicationContext.get().getFloatingObjectPresetsManager().getReferenceToUse();
|
| ... |
... |
@@ -155,6 +157,7 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto, |
|
155
|
157
|
String floatingObjectReferenceId = ref.map(FloatingObjectPreset::getFloatingObjectId).orElse(null);
|
|
156
|
158
|
form = getFloatingObjectService().preCreate(activityId, floatingObjectReferenceId);
|
|
157
|
159
|
if (floatingObjectReferenceId != null) {
|
|
|
160
|
+ useReference = true;
|
|
158
|
161
|
partsSet = getFloatingObjectService().getFloatingObjectPartByFloatingObject(floatingObjectReferenceId).toSet();
|
|
159
|
162
|
for (FloatingObjectPartReference floatingObjectPartDtoDataReference : partsSet) {
|
|
160
|
163
|
floatingObjectPartDtoDataReference.setId(null);
|
| ... |
... |
@@ -180,7 +183,7 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto, |
|
180
|
183
|
|
|
181
|
184
|
model.reset();
|
|
182
|
185
|
|
|
183
|
|
- getUi().getTable().openTable(model, partsSet, bean.isPersisted());
|
|
|
186
|
+ getUi().getTable().openTable(model, partsSet, bean.isPersisted() || useReference);
|
|
184
|
187
|
|
|
185
|
188
|
setContentMode(mode);
|
|
186
|
189
|
|