Search in sources :

Example 1 with BuildUrl

use of cn.cerc.jpage.other.BuildUrl in project summer-mis by cn-cerc.

the class AbstractGridLine method outputField.

protected void outputField(HtmlWriter html, AbstractField field) {
    Record record = dataSource.getDataSet().getCurrent();
    BuildUrl build = field.getBuildUrl();
    if (build != null) {
        UrlRecord url = new UrlRecord();
        build.buildUrl(record, url);
        if (!"".equals(url.getUrl())) {
            html.print("<a href=\"%s\"", url.getUrl());
            if (url.getTitle() != null) {
                html.print(" title=\"%s\"", url.getTitle());
            }
            if (url.getTarget() != null) {
                html.print(" target=\"%s\"", url.getTarget());
            }
            if (url.getHintMsg() != null) {
                html.print(" onClick=\"return confirm('%s');\"", url.getHintMsg());
            }
            html.print(">%s</a>", field.getText(record));
        } else {
            html.print(field.getText(record));
        }
    } else {
        html.print(field.getText(record));
    }
}
Also used : BuildUrl(cn.cerc.jpage.other.BuildUrl) Record(cn.cerc.jdb.core.Record) UrlRecord(cn.cerc.jpage.core.UrlRecord) UrlRecord(cn.cerc.jpage.core.UrlRecord)

Aggregations

Record (cn.cerc.jdb.core.Record)1 UrlRecord (cn.cerc.jpage.core.UrlRecord)1 BuildUrl (cn.cerc.jpage.other.BuildUrl)1