public void populateListControl(NeedsAssessmentListVoCollection collection) throws PresentationLogicException { clear(); if(collection != null) { for(int x = 0; x < collection.size(); x++) { if(collection.get(x) != null) { form.recbrAssessment().newRow(collection.get(x), buildHeaderTitle(collection.get(x))); } } } if(form.getGlobalContext().SpinalInjuries.NeedsAssessment.getSelectedAssessmentIsNotNull()) { form.recbrAssessment().setValue(form.getGlobalContext().SpinalInjuries.NeedsAssessment.getSelectedAssessment()); } if(form.getGlobalContext().SpinalInjuries.NeedsAssessment.getSelectedAssessmentIsNotNull() && form.recbrAssessment().getValue() != null) { form.getGlobalContext().SpinalInjuries.NeedsAssessment.setSelectedAssessment(null); if(form.getGlobalContext().SpinalInjuries.NeedsAssessment.getAssessmentWasEditedIsNotNull() && form.getGlobalContext().SpinalInjuries.NeedsAssessment.getAssessmentWasEdited().booleanValue()) form.setMode(FormMode.EDIT); } else { if(form.getLocalContext().getSelectedInstanceIsNotNull()) form.recbrAssessment().setValue(form.getLocalContext().getSelectedInstance()); else if(collection != null && collection.size() > 0) form.recbrAssessment().setValue(collection.get(collection.size() - 1)); } browseRecord(); }
public NeedsAssessmentListVoCollection list(CareContextRefVo careContext) { if(careContext == null) throw new DomainRuntimeException("Invalid care context"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from NeedsAssessment a "); hql.append(" where a.careContext.id = " + careContext.getID_CareContext()); return NeedsAssessmentListVoAssembler.createNeedsAssessmentListVoCollectionFromNeedsAssessment(factory.find(hql.toString())); }