Skip to content

Commit

Permalink
#12902 - Delete the setDefault values from edit form
Browse files Browse the repository at this point in the history
  • Loading branch information
carina29 committed Jan 25, 2024
1 parent b088437 commit 64680f8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -1419,27 +1419,19 @@ public String getFormattedHtmlMessage() {
});
}

private void hideJurisdictionFields() {

private void hideAndFillJurisdictionFields() {
getField(CaseDataDto.CASE_ORIGIN).setVisible(false);

getContent().getComponent(RESPONSIBLE_JURISDICTION_HEADING_LOC).setVisible(false);
getContent().getComponent(PLACE_OF_STAY_HEADING_LOC).setVisible(false);
differentPlaceOfStayJurisdiction.setVisible(false);

responsibleRegion.setVisible(false);
responsibleRegion.setValue(FacadeProvider.getRegionFacade().getDefaultInfrastructureReference());
responsibleDistrict.setVisible(false);
responsibleDistrict.setValue(FacadeProvider.getDistrictFacade().getDefaultInfrastructureReference());
responsibleCommunity.setVisible(false);
responsibleCommunity.setValue(FacadeProvider.getCommunityFacade().getDefaultInfrastructureReference());

regionCombo.setVisible(false);
regionCombo.setValue(FacadeProvider.getRegionFacade().getDefaultInfrastructureReference());
districtCombo.setVisible(false);
districtCombo.setValue(FacadeProvider.getDistrictFacade().getDefaultInfrastructureReference());
communityCombo.setVisible(false);
communityCombo.setValue(FacadeProvider.getCommunityFacade().getDefaultInfrastructureReference());
}

private void updateFacilityOrHome() {
Expand Down Expand Up @@ -1726,7 +1718,7 @@ public void setValue(CaseDataDto newFieldValue) throws ReadOnlyException, Conver
updateVisibilityDifferentPlaceOfStayJurisdiction(newFieldValue);

if (UiUtil.enabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
hideJurisdictionFields();
hideAndFillJurisdictionFields();
}

// HACK: Binding to the fields will call field listeners that may clear/modify the values of other fields.
Expand Down

0 comments on commit 64680f8

Please sign in to comment.