private void populateChildNodes(grdTENSRow parRow, ElectrotherapyTensTreatmentVoCollection voTensTreatmentColl) { parRow.getRows().clear(); if (voTensTreatmentColl == null || voTensTreatmentColl.size()<=0) return; //RehabilitationVo voParentInstance = form.getLocalContext().getSelectedParentInstance(); //if(voParentInstance.getClinicalContact().getID_ClinicalContact().equals // (form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact())) voTensTreatmentColl.sort(); for(int i=0; i<voTensTreatmentColl.size(); i++) { if (parRow != null) { GenForm.grdTENSRow childRow = parRow.getRows().newRow(); populateChildNode(childRow, voTensTreatmentColl.get(i)); } } //reselect parent form.grdTENS().setValue(parRow.getValue()); parRow.setExpanded(true); }
private void populateChildCollectionFromGrid(ElectrotherapyTENSVo voTENS) { if (form.grdTENS().getValue() == null) return; if (voTENS.getTensTreatments() == null) voTENS.setTensTreatments(new ElectrotherapyTensTreatmentVoCollection()); GenForm.grdTENSRow parentRow = form.grdTENS().getValue() instanceof ElectrotherapyTENSShortVo ? form.grdTENS().getSelectedRow() : form.grdTENS().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) voTENS.getTensTreatments().clear(); for (int i=0; i < parentRow.getRows().size(); i++) { voTENS.getTensTreatments().add((ElectrotherapyTensTreatmentVo) parentRow.getRows().get(i).getValue()); } }
private void newParentInstance() { ElectrotherapyTENSVo voNewParent = new ElectrotherapyTENSVo(); voNewParent.setAuthoringCP((Hcp) domain.getHcpUser()); voNewParent.setAuthoringDateTime(new DateTime()); voNewParent.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voNewParent.setTensTreatments(new ElectrotherapyTensTreatmentVoCollection()); populateParentInstanceControls(voNewParent); form.getLocalContext().setSelectedParentInstance(voNewParent); }