use of cn.cerc.jpage.fields.AbstractField in project summer-mis by cn-cerc.
the class UIFormHorizontal method output.
@Override
public void output(HtmlWriter html) {
readAll();
title.output(html);
html.print("<form method=\"%s\" id=\"%s\"", this.method, this.getId());
if (this.action != null)
html.print(" action=\"%s\"", this.action);
if (this.cssClass != null)
html.print(" class=\"%s\"", this.cssClass);
if (this.enctype != null)
html.print(" enctype=\"%s\"", this.enctype);
html.println(">");
// 输出隐藏字段
for (AbstractField field : fields) {
if (field.isHidden()) {
field.output(html);
}
}
html.println("<ul>");
// 输出正常查询字段
for (AbstractField field : fields) {
if (!field.isHidden()) {
html.print("<li");
if (field.getRole() != null)
html.print(" role='%s'", field.getRole());
if (field instanceof ExpendField)
html.print(" class=\"select\"");
html.println(">");
try {
field.output(html);
} catch (Exception e) {
html.print("<label>");
html.print(e.getMessage());
html.print("</label>");
}
html.println("</li>");
}
}
// 输出可折叠字段
String hid = "hidden";
for (AbstractField field : fields) {
if (field instanceof ExpendField) {
hid = ((ExpendField) field).getHiddenId();
break;
}
}
for (Component component : this.getExpender().getComponents()) {
if (component instanceof AbstractField) {
AbstractField field = (AbstractField) component;
html.print("<li");
html.print(" role='%s'", hid);
html.print(" style=\"display: none;\"");
html.println(">");
try {
field.output(html);
} catch (Exception e) {
html.print("<label>");
html.print(e.getMessage());
html.print("</label>");
}
html.println("</li>");
}
}
html.println("</ul>");
if (buttons != null) {
for (AbstractField field : buttons.fields) {
field.output(html);
}
}
html.println("<div></div>");
html.println("</form>");
if (levelSide != null)
levelSide.output(html);
}
use of cn.cerc.jpage.fields.AbstractField in project summer-mis by cn-cerc.
the class ExpenderGridLine method output.
@Override
public void output(HtmlWriter html, int lineNo) {
DataSet dataSet = dataSource.getDataSet();
html.print("<tr");
html.print(" id='%s_%s'", "tr" + dataSet.getRecNo(), lineNo);
html.print(" role=\"%s\"", dataSet.getRecNo());
if (!this.isVisible())
html.print(" style=\"display:none\"");
html.println(">");
for (RowCell item : this.getCells()) {
IField objField = item.getFields().get(0);
html.print("<td");
if (item.getColSpan() > 1)
html.print(" colspan=\"%d\"", item.getColSpan());
if (item.getStyle() != null)
html.print(" style=\"%s\"", item.getStyle());
if (item.getAlign() != null)
html.print(" align=\"%s\"", item.getAlign());
else if (objField.getAlign() != null)
html.print(" align=\"%s\"", objField.getAlign());
if (item.getRole() != null)
html.print(" role=\"%s\"", item.getRole());
html.print(">");
for (IField obj : item.getFields()) {
if (obj instanceof AbstractField) {
AbstractField field = (AbstractField) obj;
html.print("<span>");
if (!"".equals(field.getName())) {
html.print(field.getName());
html.print(": ");
}
if (field instanceof IColumn)
html.print(((IColumn) field).format(dataSource.getDataSet().getCurrent()));
else if (field instanceof AbstractField)
outputField(html, field);
else
throw new RuntimeException("暂不支持的数据类型:" + field.getClass().getName());
html.println("</span>");
}
}
html.println("</td>");
}
html.println("</tr>");
}
use of cn.cerc.jpage.fields.AbstractField in project summer-mis by cn-cerc.
the class AbstractGrid method addField.
@Override
public void addField(IField field) {
if (field instanceof AbstractField) {
AbstractField obj = (AbstractField) field;
obj.setOwner(masterLine);
}
masterLine.addField(field);
}
use of cn.cerc.jpage.fields.AbstractField in project summer-mis by cn-cerc.
the class UIFormVertical method output.
@Override
public void output(HtmlWriter html) {
html.print("<form method=\"%s\" id=\"%s\"", this.method, this.getId());
if (this.action != null) {
html.print(String.format(" action=\"%s\"", this.action));
}
if (this.enctype != null) {
html.print(" enctype=\"%s\"", this.enctype);
}
html.println(">");
int i = 0;
for (AbstractField field : fields) {
if (field.isHidden()) {
field.output(html);
} else {
i++;
}
}
if (i > 0) {
outputFields(html);
}
html.println("</form>");
}
use of cn.cerc.jpage.fields.AbstractField in project summer-mis by cn-cerc.
the class UIFormVertical method outputFields.
private void outputFields(HtmlWriter html) {
html.print("<ul");
if (this.CSSClass != null)
html.print(" class=\"%s\"", this.CSSClass);
html.println(">");
for (AbstractField field : fields) {
if (!field.isHidden()) {
html.print("<li");
if (field.getRole() != null)
html.print(" role='%s'", field.getRole());
html.print(">");
field.output(html);
UIText mark = field.getMark();
if (mark != null) {
html.println("<a href=\"javascript:displaySwitch('%s')\">", field.getId());
html.println("<img src=\"%s\" />", UIConfig.GUIDE);
html.println("</a>");
html.println("</li>");
html.println("<li role=\"%s\" style=\"display: none;\">", field.getId());
html.print("<mark>");
if (mark.getContent() != null)
html.println("%s", mark.getContent());
for (String line : mark.getLines()) html.println("<p>%s</p>", line);
html.println("</mark>");
html.println("</li>");
} else {
html.println("</li>");
}
}
}
html.println("</ul>");
}
Aggregations