calctextfield.java

来自「OBPM是一个开源」· Java 代码 · 共 54 行

JAVA
54
字号
package cn.myapps.core.dynaform.form.ejb;

import cn.myapps.base.action.ParamsTable;
import cn.myapps.core.dynaform.document.ejb.Document;
import cn.myapps.core.macro.runner.JavaScriptRunner;
import cn.myapps.core.user.action.WebUser;
import cn.myapps.util.StringUtil;

public class CalctextField extends FormField {

	public ValidateMessage validate(JavaScriptRunner bsf, Document doc)
			throws Exception {
		return null;
	}

	public String toTemplate() {
		StringBuffer template = new StringBuffer();
		template.append("<span'");
		template.append(" className='" + this.getClass().getName() + "'");
		template.append(" id='" + getId() + "'");
		template.append(" name='" + getName() + "'");
		template.append(" formid='" + getFormid() + "'");
		template.append(" valueScript='" + getValueScript() + "'");
		template.append("/>");
		return template.toString();
	}

	public String toHtmlTxt(ParamsTable params, WebUser user,
			JavaScriptRunner runner, Document doc) throws Exception {
		String valueScript = this.getValueScript();

		if (valueScript != null && valueScript.trim().length() > 0) {
			try {
				if (valueScript != null && valueScript.trim().length() > 0) {
					Object result = runner.run(StringUtil
							.dencodeHTML(valueScript));
					if (result instanceof String) {
						return (String) result;
					}
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		return "";
	}

	public String toPrintHtmlTxt(ParamsTable params, WebUser user,
			JavaScriptRunner runner, Document doc) throws Exception {
		return toHtmlTxt(params, user, runner, doc);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?