/** Create a new instance of TransfertReference */ private void createNewTransfertReference() { request = requestFactory.transfertReferenceRequest(); /* create a new intance of TransfertReference */ TransfertReferenceProxy newTransfertReference = request.create(TransfertReferenceProxy.class); newTransfertReference.setId(ImogKeyGenerator.generateKeyId("TRANS_REF")); /* push the instance to the editor */ current = newTransfertReference; editorDriver.edit(current, request); /* set request context for list editor operations */ editor.setRequestContextForListEditors(request); /* update field widgets in editor */ editor.computeVisibility(null, true); // Field districtSante depends on the value of field region editor.getDistrictSanteFilteredByRegion(null); // Field cDTDepart depends on the value of field districtSante editor.getCDTDepartFilteredByDistrictSante(null); // Field districtSanteArrivee depends on the value of field regionArrivee editor.getDistrictSanteArriveeFilteredByRegionArrivee(null); // Field cDTArrivee depends on the value of field districtSanteArrivee editor.getCDTArriveeFilteredByDistrictSanteArrivee(null); editor.getPatientFilteredByCDTDepart(null); editor.setEdited(true); }
/** Edit the current instance of TransfertReference in editor */ @Override protected void edit() { /* set the instance in edit mode in the editor */ editor.setEdited(true); /* update field widgets in editor */ // Field districtSante depends on the value of field region editor.getDistrictSanteFilteredByRegion(current.getRegion()); // Field cDTDepart depends on the value of field districtSante editor.getCDTDepartFilteredByDistrictSante(current.getDistrictSante()); // Field districtSanteArrivee depends on the value of field regionArrivee editor.getDistrictSanteArriveeFilteredByRegionArrivee(current.getRegionArrivee()); // Field cDTArrivee depends on the value of field districtSanteArrivee editor.getCDTArriveeFilteredByDistrictSanteArrivee(current.getDistrictSanteArrivee()); editor.getPatientFilteredByCDTDepart(current.getCDTDepart()); }
@Override protected void cancel() { if (parent != null) parent.hide(); else { if (isNew) requestFactory.getEventBus().fireEvent(closeEvent); else requestFactory .getEventBus() .fireEvent(new ViewTransfertReferenceEvent(current.getId(), closeEvent)); } }