private void populateChildNodes(gridDetailsRow parRow, BobathTreatmentVoCollection voCollBobathTreatments) { parRow.getRows().clear(); if (voCollBobathTreatments == null || voCollBobathTreatments.size()<=0) return; voCollBobathTreatments.sort(); for(int i=0; i<voCollBobathTreatments.size(); i++) { if (parRow != null) { GenForm.gridDetailsRow childRow = parRow.getRows().newRow(); populateChildNode(childRow, voCollBobathTreatments.get(i)); } } //reselect parent parRow.setValue(form.getLocalContext().getSelectedParentInstance()); form.gridDetails().setValue(parRow.getValue()); parRow.setExpanded(true); }
private void populateChildCollectionFromGrid(BobathVo voBobath) { if (form.gridDetails().getValue() == null) return; if (voBobath.getBobathTreatment() == null) voBobath.setBobathTreatment(new BobathTreatmentVoCollection()); GenForm.gridDetailsRow parentRow = form.gridDetails().getValue() instanceof BobathVo || form.gridDetails().getValue() instanceof BobathShortVo ? form.gridDetails().getSelectedRow() : form.gridDetails().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) voBobath.getBobathTreatment().clear(); for (int i=0; i < parentRow.getRows().size(); i++) { voBobath.getBobathTreatment().add((BobathTreatmentVo) parentRow.getRows().get(i).getValue()); } }
private void newParentInstance() { BobathVo voNewParent = new BobathVo(); Hcp voHcp = (Hcp) domain.getHcpUser(); if(voHcp != null) voNewParent.setAuthoringHCP(voHcp); voNewParent.setAuthoringDateTime(new DateTime()); voNewParent.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voNewParent.setBobathTreatment(new BobathTreatmentVoCollection()); populateParentInstanceControls(voNewParent); form.getLocalContext().setSelectedParentInstance(voNewParent); }