use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class DoubleField method getText.
@Override
public String getText(Record dataSet) {
if (dataSet == null)
return null;
if (buildText != null) {
HtmlWriter html = new HtmlWriter();
buildText.outputText(dataSet, html);
return html.toString();
}
try {
double val = dataSet.getDouble(field);
DecimalFormat df = new DecimalFormat(format);
return df.format(val);
} catch (NumberFormatException e) {
return "0";
}
}
use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class OptionField method getText.
@Override
public String getText(Record dataSet) {
if (dataSet == null)
return null;
if (buildText != null) {
HtmlWriter html = new HtmlWriter();
buildText.outputText(dataSet, html);
return html.toString();
}
return dataSet.getString(getField());
}
use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class CheckEditor method format.
public String format(Record ds) {
String data = ds.getString(owner.getField());
HtmlWriter html = new HtmlWriter();
html.print("<input");
html.print(" id='%s'", owner.getId());
html.print(" type='checkbox'");
html.print(" name='%s'", owner.getField());
html.print(" value='true'");
html.print(" autocomplete='off'");
html.print(" data-%s='[%s]'", owner.getField(), data);
if (ds.getBoolean(owner.getField()))
html.print(" checked");
if (onUpdate != null)
html.print(" onclick=\"tableOnChanged(this,'%s')\"", onUpdate);
else
html.print(" onclick='tableOnChanged(this)'");
html.println("/>");
return html.toString();
}
use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class CustomField method getText.
@Override
public String getText(Record ds) {
if (buildText == null)
return "";
HtmlWriter html = new HtmlWriter();
buildText.outputText(ds, html);
return html.toString();
}
use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class OperaField method getText.
@Override
public String getText(Record dataSet) {
if (buildText != null) {
HtmlWriter html = new HtmlWriter();
buildText.outputText(dataSet, html);
return html.toString();
}
return this.value;
}
Aggregations