private void populateChildNodes(grdFunctionalTransRow parRow, FunctionalTransfersTechniqueVoCollection voFunctTransTechniqueColl) { parRow.getRows().clear(); if (voFunctTransTechniqueColl == null || voFunctTransTechniqueColl.size() <= 0) return; // RehabilitationVo voParentInstance = // form.getLocalContext().getSelectedParentInstance(); // if(voParentInstance.getClinicalContact().getID_ClinicalContact().equals // (form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact())) voFunctTransTechniqueColl.sort(); for (int i = 0; i < voFunctTransTechniqueColl.size(); i++) { if (parRow != null) { GenForm.grdFunctionalTransRow childRow = parRow.getRows().newRow(); populateChildNode(childRow, voFunctTransTechniqueColl.get(i)); } } // reselect parent form.grdFunctionalTrans().setValue(parRow.getValue()); parRow.setExpanded(true); }
private void populateChildCollectionFromGrid(FunctionalTransfersVo voFunctionalTransfers) { if (form.grdFunctionalTrans().getValue() == null) return; if (voFunctionalTransfers.getMovements() == null) voFunctionalTransfers.setMovements(new FunctionalTransfersTechniqueVoCollection()); GenForm.grdFunctionalTransRow parentRow = form.grdFunctionalTrans().getValue() instanceof FunctionalTransfersShortVo ? form.grdFunctionalTrans().getSelectedRow() : form.grdFunctionalTrans().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0) voFunctionalTransfers.getMovements().clear(); for (int i = 0; i < parentRow.getRows().size(); i++) { voFunctionalTransfers.getMovements().add((FunctionalTransfersTechniqueVo) parentRow.getRows().get(i).getValue()); } }
private void newParentInstance() { FunctionalTransfersVo voNewParent = new FunctionalTransfersVo(); voNewParent.setAuthoringCP((HcpLiteVo) domain.getHcpLiteUser()); voNewParent.setAuthoringDateTime(new DateTime()); voNewParent.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voNewParent.setMovements(new FunctionalTransfersTechniqueVoCollection()); populateParentInstanceControls(voNewParent); loadEquipment(); loadTechnique(); form.getLocalContext().setSelectedParentInstance(voNewParent); }