Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
1e517b43
by Tony Chemit at 2023-02-14T11:13:09+01:00
2 changed files:
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SetCatchUI.jcss
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SetCatchUITableModel.java
Changes:
| ... | ... | @@ -24,3 +24,6 @@ |
| 24 | 24 | _focusComponent:{species};
|
| 25 | 25 | }
|
| 26 | 26 | |
| 27 | +#weightMeasureMethod {
|
|
| 28 | + enabled: {tableEditBean.getCatchWeight() != null && tableEditBean.getCatchWeightComputedSource() == null};
|
|
| 29 | +} |
| ... | ... | @@ -78,10 +78,7 @@ class SetCatchUITableModel extends GeneratedSetCatchUITableModel { |
| 78 | 78 | CatchDto source = (CatchDto) evt.getSource();
|
| 79 | 79 | source.setTotalCountComputedSource(null);
|
| 80 | 80 | };
|
| 81 | - catchWeightChanged = evt -> {
|
|
| 82 | - CatchDto source = (CatchDto) evt.getSource();
|
|
| 83 | - source.setCatchWeightComputedSource(null);
|
|
| 84 | - };
|
|
| 81 | + catchWeightChanged = evt -> onWeightChanged((Float) evt.getNewValue(), !ui.getStates().isResetEdit());
|
|
| 85 | 82 | meanWeightChanged = evt -> {
|
| 86 | 83 | CatchDto source = (CatchDto) evt.getSource();
|
| 87 | 84 | source.setMeanWeightComputedSource(null);
|
| ... | ... | @@ -146,6 +143,7 @@ class SetCatchUITableModel extends GeneratedSetCatchUITableModel { |
| 146 | 143 | |
| 147 | 144 | @Override
|
| 148 | 145 | protected void onSelectedRowChanged(SetCatchUI ui, int editingRow, CatchDto tableEditBean, CatchDto previousRowBean, boolean notPersisted, boolean newRow) {
|
| 146 | + |
|
| 149 | 147 | super.onSelectedRowChanged(ui, editingRow, tableEditBean, previousRowBean, notPersisted, newRow);
|
| 150 | 148 | |
| 151 | 149 | tableEditBean.removePropertyChangeListener(CatchDto.PROPERTY_TOTAL_COUNT, totalCountChanged);
|
| ... | ... | @@ -176,4 +174,14 @@ class SetCatchUITableModel extends GeneratedSetCatchUITableModel { |
| 176 | 174 | // No specific message
|
| 177 | 175 | return null;
|
| 178 | 176 | }
|
| 177 | + |
|
| 178 | + protected void onWeightChanged(Float newValue, boolean realChange) {
|
|
| 179 | + CatchDto tableEditBean = getTableEditBean();
|
|
| 180 | + if (realChange) {
|
|
| 181 | + tableEditBean.setCatchWeightComputedSource(null);
|
|
| 182 | + }
|
|
| 183 | + if (newValue == null) {
|
|
| 184 | + tableEditBean.setWeightMeasureMethod(null);
|
|
| 185 | + }
|
|
| 186 | + }
|
|
| 179 | 187 | } |