private void populateChildCollectionFromGrid(MobilisationsVo voMobilisation) { if (form.grdTreatments().getValue() == null) return; if (voMobilisation.getMobilisationsTreatment() == null) voMobilisation.setMobilisationsTreatment(new MobilisationsTreatmentVoCollection()); GenForm.grdTreatmentsRow parentRow = form.grdTreatments().getValue() instanceof MobilisationsShortVo || form.grdTreatments().getValue() instanceof MobilisationsVo ? form.grdTreatments().getSelectedRow() : form.grdTreatments().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) voMobilisation.getMobilisationsTreatment().clear(); for (int i=0; i < parentRow.getRows().size(); i++) { voMobilisation.getMobilisationsTreatment().add((MobilisationsTreatmentVo) parentRow.getRows().get(i).getValue()); } }
private void populateChildNodes(grdTreatmentsRow parRow, MobilisationsTreatmentVoCollection voMobTreatmentColl) { if (voMobTreatmentColl == null || voMobTreatmentColl.size()<=0) return; voMobTreatmentColl.sort(); for(int i=0; i<voMobTreatmentColl.size(); i++) { if (parRow != null) { GenForm.grdTreatmentsRow childRow = parRow.getRows().newRow(); populateChildNode(childRow, voMobTreatmentColl.get(i)); } } }
private void newParentInstance() { MobilisationsVo voNewParent = new MobilisationsVo(); Hcp voHcp = (Hcp) domain.getHcpUser(); voNewParent.setAuthoringCP(voHcp); voNewParent.setAuthoringDateTime(new DateTime()); voNewParent.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voNewParent.setMobilisationsTreatment(new MobilisationsTreatmentVoCollection()); populateParentInstanceControls(voNewParent); form.getLocalContext().setSelectedParentInstance(voNewParent); form.getLocalContext().setUpdatingParentInstance(voNewParent); enableParentControls(); }