use of org.akaza.openclinica.controller.helper.table.SubjectSDVContainer in project OpenClinica by OpenClinica.
the class SDVController method renderSubjectsTable.
/*
Create a JMesa-based table for showing the event CRFs.
*/
private String renderSubjectsTable(List<EventCRFBean> eventCRFBeans, int studySubjectId, HttpServletRequest request) {
StudySubjectDAO studySubjectDAO = new StudySubjectDAO(dataSource);
StudySubjectBean subjectBean = (StudySubjectBean) studySubjectDAO.findByPK(studySubjectId);
Collection<SubjectSDVContainer> items = sdvUtil.getSubjectRows(eventCRFBeans, request);
//The number of items represents the total number of returned rows
int totalRowCount = 0;
if (items != null && items.size() > 0) {
totalRowCount = items.size();
}
TableFacade tableFacade = createTableFacade("sdv", request);
//set to the total row count
if (totalRowCount > 1) {
tableFacade.setMaxRowsIncrements(15, 50, totalRowCount);
}
tableFacade.setColumnProperties("studySubjectId", "personId", "secondaryId", "eventName", "eventDate", "enrollmentDate", "subjectStatus", "crfNameVersion", "crfStatus", "lastUpdatedDate", "lastUpdatedBy", "sdvStatusActions");
tableFacade.setItems(items);
//Fix column titles
HtmlTable table = (HtmlTable) tableFacade.getTable();
//i18n caption; TODO: convert to Spring messages
ResourceBundle resourceBundle = ResourceBundle.getBundle("org.akaza.openclinica.i18n.words", LocaleResolver.getLocale(request));
String[] allTitles = { resourceBundle.getString("study_subject_ID"), resourceBundle.getString("person_ID"), resourceBundle.getString("secondary_ID"), resourceBundle.getString("event_name"), resourceBundle.getString("event_date"), resourceBundle.getString("enrollment_date"), resourceBundle.getString("subject_status"), resourceBundle.getString("CRF_name") + " / " + resourceBundle.getString("version"), resourceBundle.getString("CRF_status"), resourceBundle.getString("last_updated_date"), resourceBundle.getString("last_updated_by"), resourceBundle.getString("SDV_status") + " / " + resourceBundle.getString("actions") };
setTitles(allTitles, table);
table.getTableRenderer().setWidth("800");
return tableFacade.render();
}
Aggregations