123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- /*
- * Created on 2006-6-6
- * Administrator
- */
- package com.sysmodel.xformmodel.importcontrol;
- import com.sysmodel.XFormFactory;
- import com.sysmodel.XFormModel;
- import com.sysmodel.xformmodel.able.Validate;
- public class TreeControl extends AbstractControl{
- /**
- * 文本框的长度
- */
- private String size = "";
- /**
- * 1 用引用表形成树 2 用引用编码表形成树 3 自定义常量树 4 自定义引用表树
- */
- private String type = "";
- /**
- * 引用表形成树:classid 引用编码表形成树:常量名
- */
- private String referenceTable = "";
- /**
- * 只引用表有用
- */
- private String storeCode = "";
- /**
- * 只引用表有用
- */
- private String displayName = "";
- /**
- * 只引用表有用
- */
- private String parentCode = "";
- /**
- * 自定义脚本 (自定义常量树 ,自定义引用表树)
- */
- private String customDefine = "";
- /**
- * 只引用表有用 条件
- */
- private String condition = "";
- /**
- * 只引用表有用 排序
- */
- private String order = "";
- private boolean leafonly = false;
- private static XFormModel XFormModel = XFormFactory.getXFormModel();
- /**
- * setConstantTree(constantName,leafonly,hiddenObject,displayObject)
- * setReferenceTableTree
- * (referenceclassid,leafonly,hiddenObject,displayObject
- * ,storeCode,displayName,parentCode,condition,order)
- */
- public String produceHtml(String name, String value, String displayValue, Validate Validate) {
- StringBuffer sb = new StringBuffer("<input type=\"hidden\" name=\"");
- sb.append(name).append("\" value=\"");
- sb.append(value).append("\">");
- sb.append("<input type=\"text\" name=\"");
- sb.append(name + "Show\" readonly value=\"");
- sb.append(displayValue).append("\"");
- String css = XFormModel.getCSSValue("TreeCss");
- if (!css.equals(""))
- sb.append(" class=\"" + css + "\"");
- if (!size.equals(""))
- sb.append(" size=\"" + size + "\"");
- sb.append(" onfocus=\"");
- if (type.equals("1")) {// table
- sb.append("setReferenceTableTree('" + referenceTable).append(
- "'," + leafonly + ",document.forms[0].elements['" + name + "'],this,'");
- sb.append(storeCode + "','").append(displayName + "','");
- sb.append(parentCode + "','").append(condition + "','").append(order + "');");
- } else if (type.equals("2")) {// constant
- sb.append("referenceTable('" + referenceTable).append(
- "'," + leafonly + ",document.forms[0].elements['" + name + "'],this);");
- } else {// other
- sb.append(customDefine);
- }
- sb.append("\">");
- return sb.toString();
- }
- public String getCondition() {
- return condition;
- }
- public void setCondition(String condition) {
- this.condition = condition;
- }
- public String getCustomDefine() {
- return customDefine;
- }
- public void setCustomDefine(String customDefine) {
- this.customDefine = customDefine;
- }
- public String getDisplayName() {
- return displayName;
- }
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
- public boolean isLeafonly() {
- return leafonly;
- }
- public void setLeafonly(boolean leafonly) {
- this.leafonly = leafonly;
- }
- public String getOrder() {
- return order;
- }
- public void setOrder(String order) {
- this.order = order;
- }
- public String getParentCode() {
- return parentCode;
- }
- public void setParentCode(String parentCode) {
- this.parentCode = parentCode;
- }
- public String getReferenceTable() {
- return referenceTable;
- }
- public void setReferenceTable(String referenceTable) {
- this.referenceTable = referenceTable;
- }
- public String getSize() {
- return size;
- }
- public void setSize(String size) {
- this.size = size;
- }
- public String getStoreCode() {
- return storeCode;
- }
- public void setStoreCode(String storeCode) {
- this.storeCode = storeCode;
- }
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
- }
|