private void populateChildNodes(grdAreaRow parRow, StretchingDetailsVoCollection voStretchingDetailsColl) { parRow.getRows().clear(); if (voStretchingDetailsColl == null || voStretchingDetailsColl.size()<=0) return; //RehabilitationVo voParentInstance = form.getLocalContext().getSelectedParentInstance(); //if(voParentInstance.getClinicalContact().getID_ClinicalContact().equals // (form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact())) voStretchingDetailsColl.sort(); for(int i=0; i<voStretchingDetailsColl.size(); i++) { if (parRow != null) { GenForm.grdAreaRow childRow = parRow.getRows().newRow(); populateChildNode(childRow, voStretchingDetailsColl.get(i)); } } //reselect parent form.grdArea().setValue(parRow.getValue()); parRow.setExpanded(true); }
private void populateChildCollectionFromGrid(StretchingVo voStretching) { if (form.grdArea().getValue() == null) return; if (voStretching.getStretchingDetails() == null) voStretching.setStretchingDetails(new StretchingDetailsVoCollection()); GenForm.grdAreaRow parentRow = form.grdArea().getValue() instanceof StretchingShortVo ? form.grdArea().getSelectedRow() : form.grdArea().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) voStretching.getStretchingDetails().clear(); for (int i=0; i < parentRow.getRows().size(); i++) { voStretching.getStretchingDetails().add((StretchingDetailsVo) parentRow.getRows().get(i).getValue()); } }
private void newParentInstance() { StretchingVo voNewParent = new StretchingVo(); voNewParent.setAuthoringCP((Hcp) domain.getHcpUser()); voNewParent.setAuthoringDateTime(new DateTime()); voNewParent.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voNewParent.setStretchingDetails(new StretchingDetailsVoCollection()); populateParentInstanceControls(voNewParent); form.getLocalContext().setSelectedParentInstance(voNewParent); }