use of org.jmesa.view.html.component.HtmlRow in project OpenClinica by OpenClinica.
the class ViewCRFServlet method renderStudiesTable.
/*
* Create a JMesa-based table for showing the studies associated with a CRF.
*/
private String renderStudiesTable(List<StudyBean> studyBeans) {
Collection<StudyRowContainer> items = getStudyRows(studyBeans);
TableFacade tableFacade = createTableFacade("studies", request);
tableFacade.setColumnProperties("name", "uniqueProtocolid", "actions");
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 captionText = resourceBundle.getString("studies_using_crf");
* if (captionText == null || "".equalsIgnoreCase(captionText)) {
* captionText = "Studies Using this CRF for Data Entry";
* }
* table.setCaption(captionText);
*/
HtmlRow row = table.getRow();
SDVUtil sDVUtil = new SDVUtil();
String[] colNames = new String[] { "name", "uniqueProtocolid", "actions" };
sDVUtil.setHtmlCellEditors(tableFacade, colNames, true);
HtmlColumn firstName = row.getColumn("name");
firstName.setTitle("Study Name");
HtmlColumn protocol = row.getColumn("uniqueProtocolid");
protocol.setTitle("Unique Protocol Id");
HtmlColumn actions = row.getColumn("actions");
actions.setTitle("Actions");
return tableFacade.render();
}
use of org.jmesa.view.html.component.HtmlRow in project OpenClinica by OpenClinica.
the class SDVUtil method formatColumns.
public void formatColumns(HtmlTable table, String[] columnNames, HttpServletRequest request) {
Locale locale = ResourceBundleProvider.localeMap.get(Thread.currentThread());
if (locale == null) {
ResourceBundleProvider.updateLocale(LocaleResolver.getLocale(request));
}
ResourceBundle bundle = ResourceBundleProvider.getFormatBundle();
String format = bundle.getString("date_time_format_string");
HtmlRow row = table.getRow();
HtmlColumn column = null;
for (String colName : columnNames) {
column = row.getColumn(colName);
if (column != null) {
column.getCellRenderer().setCellEditor(new DateCellEditor(format));
}
}
}
use of org.jmesa.view.html.component.HtmlRow in project OpenClinica by OpenClinica.
the class SDVUtil method turnOffSorts.
public void turnOffSorts(TableFacade tableFacade, String[] colNames) {
HtmlRow row = (HtmlRow) tableFacade.getTable().getRow();
HtmlColumn col = null;
for (String colName : colNames) {
col = row.getColumn(colName);
col.setSortable(false);
}
}
use of org.jmesa.view.html.component.HtmlRow in project OpenClinica by OpenClinica.
the class SDVUtil method turnOffFilters.
public void turnOffFilters(TableFacade tableFacade, String[] colNames) {
HtmlRow row = (HtmlRow) tableFacade.getTable().getRow();
HtmlColumn col = null;
for (String colName : colNames) {
col = row.getColumn(colName);
col.setFilterable(false);
}
}
use of org.jmesa.view.html.component.HtmlRow in project OpenClinica by OpenClinica.
the class SDVUtil method setTitles.
/* Create the titles for the HTML table's rows */
public void setTitles(String[] allTitles, HtmlTable table) {
HtmlRow row = table.getRow();
HtmlColumn tempColumn = null;
for (int i = 0; i < allTitles.length; i++) {
tempColumn = row.getColumn(i);
tempColumn.setTitle(allTitles[i]);
}
}
Aggregations