private void populateChildCollectionFromGrid(StandingSessionVo voStandingSession) { if (form.grdSummary().getValue() == null) return; if (voStandingSession.getFrameExercise() == null) voStandingSession.setFrameExercise(new FrameExerciseVoCollection()); if(voStandingSession.getTiltTableExercise() == null) voStandingSession.setTiltTableExercise(new TiltExerciseVoCollection()); GenForm.grdSummaryRow parentRow = form.grdSummary().getValue() instanceof StandingSessionShortVo || form.grdSummary().getValue() instanceof StandingSessionVo ? form.grdSummary().getSelectedRow() : form.grdSummary().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) { voStandingSession.getTiltTableExercise().clear(); voStandingSession.getFrameExercise().clear(); } for (int i=0; i < parentRow.getRows().size(); i++) { if(parentRow.getRows().get(i).getValue() instanceof TiltExerciseVo) voStandingSession.getTiltTableExercise().add((TiltExerciseVo) parentRow.getRows().get(i).getValue()); if(parentRow.getRows().get(i).getValue() instanceof FrameExerciseVo) voStandingSession.getFrameExercise().add((FrameExerciseVo) parentRow.getRows().get(i).getValue()); } }
private void populateChildNodes(grdSummaryRow parRow, StandingSessionVo voParentInstance) { GenForm.grdSummaryRow childRow; FrameExerciseVoCollection voFrameColl = voParentInstance.getFrameExercise(); TiltExerciseVoCollection voTiltColl = voParentInstance.getTiltTableExercise(); if ((voFrameColl == null && voFrameColl.size()<=0) || (voTiltColl == null && voTiltColl.size()<=0)) return; voFrameColl.sort(); voTiltColl.sort(); for(int i=0; i<voFrameColl.size(); i++) { if (parRow != null) { childRow = parRow.getRows().newRow(); populateChildNode(childRow, voFrameColl.get(i)); } } for(int z=0; z<voTiltColl.size(); z++) { if (parRow != null) { childRow = parRow.getRows().newRow(); populateChildNode(childRow, voTiltColl.get(z)); } } //reselect parent parRow.setValue(form.getLocalContext().getSelectedParentInstance()); form.grdSummary().setValue(parRow.getValue()); parRow.setExpanded(true); }