private void populateClinicalTaskGrid() { HospitalAtNightClinicalTaskCollection coll = ims.clinical.vo.lookups.LookupHelper.getHospitalAtNightClinicalTask(domain.getLookupService()); form.grdTasks().getRows().clear(); if(coll == null || coll.size() ==0) return; for(int i=0; i<coll.size(); i++) { grdTasksRow row = form.grdTasks().getRows().newRow(); row.setColTaskName(coll.get(i).getText()); row.setValue(coll.get(i)); } }
private HospitalAtNightClinicalTaskCollection populateFromClinicalTasksGrid() { HospitalAtNightClinicalTaskCollection coll = new HospitalAtNightClinicalTaskCollection(); for(int i=0; i<form.grdTasks().getRows().size(); i++) { if(form.grdTasks().getRows().get(i).getColSelect()) { coll.add(form.grdTasks().getRows().get(i).getValue()); } } if(coll.size() == 0) return null; return coll; }
private HospitalAtNightClinicalTaskCollection getClinicalTasksFromScreen() { HospitalAtNightClinicalTaskCollection tasks = new HospitalAtNightClinicalTaskCollection(); for(int i=0; i< form.grdClinicalTask().getRows().size(); i++) { if(form.grdClinicalTask().getRows().get(i).getValue() instanceof HospitalAtNightClinicalTask) tasks.add(form.grdClinicalTask().getRows().get(i).getValue()); } return tasks.size() > 0 ? tasks : null; }
private void populateClinicalTasksGrid(HospitalAtNightClinicalTaskCollection hospitalAtNightClinicalTaskCollection) { form.grdClinicalTask().getRows().clear(); if(hospitalAtNightClinicalTaskCollection == null || hospitalAtNightClinicalTaskCollection.size() == 0) return; for(int i=0; i<hospitalAtNightClinicalTaskCollection.size(); i++) { grdClinicalTaskRow row = form.grdClinicalTask().getRows().newRow(); row.setColClinicalTask(hospitalAtNightClinicalTaskCollection.get(i).getText()); row.setValue(hospitalAtNightClinicalTaskCollection.get(i)); } }
@Override protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { HospitalAtNightClinicalTaskCollection selectedInstances = populateFromClinicalTasksGrid(); if(selectedInstances == null || selectedInstances.size() == 0) { engine.showErrors(new String[] {"Please select at least one Clinical Task."}); return; } form.getGlobalContext().Clinical.setClinicalTasks(selectedInstances); engine.close(DialogResult.OK); }