Search in sources :

Example 1 with SDVUtil

use of org.akaza.openclinica.web.table.sdv.SDVUtil in project OpenClinica by OpenClinica.

the class ScheduledJobTableFactory method configureColumns.

@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
    tableFacade.setColumnProperties("datasetId", "fireTime", "exportFileName", "jobStatus", "action");
    // TODO the following is throwing null pointer, check later
    resword = ResourceBundleProvider.getWordsBundle(locale);
    Row row = tableFacade.getTable().getRow();
    String[] allTitles = new String[] { "DataSet Name", "Fire Time", "Export File", "Job Status", "Actions" };
    // TODO check if this is viable
    SDVUtil sdvUtil = new SDVUtil();
    sdvUtil.setTitles(allTitles, (HtmlTable) tableFacade.getTable());
    //       HtmlColumn sdvStatus = ((HtmlRow) row).getColumn("checkbox");
    //       sdvStatus.getFilterRenderer().setFilterEditor(new SdvStatusFilter());
    sdvUtil.setHtmlCellEditors(tableFacade, new String[] { "action" }, false);
    configureColumn(row.getColumn("action"), "Actions", sdvUtil.getCellEditorNoEscapes(), new DefaultActionsEditor(locale), true, false);
}
Also used : SDVUtil(org.akaza.openclinica.web.table.sdv.SDVUtil) DefaultActionsEditor(org.akaza.openclinica.control.DefaultActionsEditor) Row(org.jmesa.view.component.Row)

Example 2 with SDVUtil

use of org.akaza.openclinica.web.table.sdv.SDVUtil 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();
}
Also used : HtmlTable(org.jmesa.view.html.component.HtmlTable) SDVUtil(org.akaza.openclinica.web.table.sdv.SDVUtil) TableFacadeFactory.createTableFacade(org.jmesa.facade.TableFacadeFactory.createTableFacade) TableFacade(org.jmesa.facade.TableFacade) HtmlRow(org.jmesa.view.html.component.HtmlRow) HtmlColumn(org.jmesa.view.html.component.HtmlColumn)

Aggregations

SDVUtil (org.akaza.openclinica.web.table.sdv.SDVUtil)2 DefaultActionsEditor (org.akaza.openclinica.control.DefaultActionsEditor)1 TableFacade (org.jmesa.facade.TableFacade)1 TableFacadeFactory.createTableFacade (org.jmesa.facade.TableFacadeFactory.createTableFacade)1 Row (org.jmesa.view.component.Row)1 HtmlColumn (org.jmesa.view.html.component.HtmlColumn)1 HtmlRow (org.jmesa.view.html.component.HtmlRow)1 HtmlTable (org.jmesa.view.html.component.HtmlTable)1