private void populateChildNodes(grdActivityRow parRow, RemedialActivityVoCollection voRemedialActivityColl) { parRow.getRows().clear(); if (voRemedialActivityColl == null || voRemedialActivityColl.size()<=0) return; voRemedialActivityColl.sort(); for(int i=0; i<voRemedialActivityColl.size(); i++) { if (parRow != null) { GenForm.grdActivityRow childRow = parRow.getRows().newRow(); populateChildNode(childRow, voRemedialActivityColl.get(i)); } } //reselect parent parRow.setValue(form.getLocalContext().getSelectedParentInstance()); form.grdActivity().setValue(parRow.getValue()); parRow.setExpanded(true); }
private void populateChildCollectionFromGrid(RemedialVo voRemedial) { if (form.grdActivity().getValue() == null) return; if (voRemedial.getRemedialActivity() == null) voRemedial.setRemedialActivity(new RemedialActivityVoCollection()); GenForm.grdActivityRow parentRow = form.grdActivity().getValue() instanceof RemedialShortVo || form.grdActivity().getValue() instanceof RemedialVo ? form.grdActivity().getSelectedRow() : form.grdActivity().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) voRemedial.getRemedialActivity().clear(); for (int i=0; i < parentRow.getRows().size(); i++) { voRemedial.getRemedialActivity().add((RemedialActivityVo) parentRow.getRows().get(i).getValue()); } }
private void newParentInstance() { RemedialVo voNewParent = new RemedialVo(); Hcp voHcp = (Hcp) domain.getHcpUser(); if(voHcp != null) voNewParent.setAuthoringCP(voHcp); voNewParent.setAuthoringDateTime(new DateTime()); voNewParent.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voNewParent.setRemedialActivity(new RemedialActivityVoCollection()); populateParentInstanceControls(voNewParent); form.getLocalContext().setSelectedParentInstance(voNewParent); }