<%@ page pageEncoding="UTF-8"%> <%@ page contentType="text/html; charset=UTF-8" language="java" %> <%@ page language="java" import="java.util.ArrayList, com.sysmodel.XFormFactory, com.sysmodel.XFormModel, com.sysmodel.collectmodel.xmlmodel.able.FormCollection, com.sysmodel.XFormModelImpl, com.sysmodel.collectmodel.xmlmodel.able.*, com.sysmodel.collectmodel.xmlmodel.impl.*"%> <% String pageid = request.getParameter("pagid") == null ? "" : request.getParameter("pagid"); if(pageid.equals("")) return; String sessionReload = request.getParameter("sessionReload") == null ? "false" : request.getParameter("sessionReload"); FormCollection FormCollectionClone = null; if(session.getAttribute("FormCollect"+pageid) == null || sessionReload.equals("true")){ if(!pageid.equals("")){ FormCollection FormCollection0bj = XFormFactory.getXFormModel().getFormCollection(pageid); FormCollectionClone = (FormCollection)FormCollection0bj.clone(); session.setAttribute("FormCollect"+pageid,FormCollection0bj.clone()); } else{ return; } } else { FormCollectionClone = (FormCollection)session.getAttribute("FormCollect"+pageid); } %>
发布到客户端 撤销到系统在用的设计
采集表单属性
 
定义选择输入构件
定义多选输入构件
定义单选输入构件
定义日期输入构件
定义文本框输入构件
定义树形输入构件
定义文本域输入构件
排序输入构件
 
定义表单按钮
排序按钮

<% if(FormCollectionClone.getPageHead() != null) out.print(FormCollectionClone.getPageHead().getPageTitle()); %>
<% PageBodyImpl PageBody =(PageBodyImpl)FormCollectionClone.getPageBody(); XFormModel XFormModel = XFormFactory.getXFormModel(); String width = PageBody.getWidth(); String height = PageBody.getHeight(); String labelWidth = PageBody.getLabelWidth(); String controlWidth = PageBody.getControlWidth(); String labelAlign = PageBody.getLabelAlign(); String controlAlign =PageBody.getControlAlign(); ArrayList alReportFields = PageBody.getAllReportFields(); ArrayList alHiddenFields = PageBody.getAlHiddenFields(); int columnCount = PageBody.getColumnCount(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < alHiddenFields.size(); i++) { HiddenField field = (HiddenField) alHiddenFields.get(i); sb.append(field.getHiddenInput(request)).append("\n"); } sb.append(""); boolean nextLine = true; int currentCount = 0; String FontTextCss = XFormModel.getCSSValue("FontTextCss"); FontTextCss = FontTextCss.equals("")? "":" class=\"" + FontTextCss + "\""; short[] widthFlag = new short[columnCount * 2]; String htmlLabelWidth = labelWidth.equals("") ? "" : " width=\"" + labelWidth+ "\""; String htmControlWidth = controlWidth.equals("") ? "" : " width=\""+ controlWidth + "\""; String htmlLabelAlign = labelAlign.equals("") ? "" : " align=\"" + labelAlign+ "\""; String htmControlAlign = controlAlign.equals("") ? "" : " align=\""+ controlAlign + "\""; String LineCssA = XFormModel.getCSSValue("LineCssA"); String LineCssB = XFormModel.getCSSValue("LineCssB"); LineCssA = LineCssA.equals("") ? "" : " class=\"" + LineCssA + "\""; LineCssB = LineCssB.equals("") ? "" : " class=\"" + LineCssB + "\""; boolean currentLineCss = true; for (int i = 0; i < alReportFields.size(); i++) { ReportField field = (ReportField) alReportFields.get(i); String scospan = field.getColspan(); scospan = scospan.equals("") ? "1" : scospan; int iColspan = Integer.parseInt(scospan); int result = currentCount + iColspan; if (result > columnCount) { int tdCount = columnCount - currentCount; for (int j = 0; j < tdCount; j++) { int index = currentCount + j; if (widthFlag[index] == 0) { widthFlag[index] = 1; widthFlag[index + 1] = 1; sb.append(""); sb.append(""); } else { sb.append("").append(""); } } sb.append(""); nextLine = true; currentCount = 0; } if (nextLine) { if (currentLineCss) sb.append(""); else sb.append(""); nextLine = false; currentLineCss = !currentLineCss; } if (field.getName().equals("")) { int colspan = iColspan * 2; sb.append(""); } else { sb.append(""); sb.append("" + field.getLabel()).append(""); if(field.getValidate().isNeed()) sb.append(" *"); sb.append(""); sb.append(" 1) { int colspan = iColspan * 2 - 1; sb.append(" colspan=\"").append(colspan + "\""); } else { if (widthFlag[currentCount + 1] == 0) { widthFlag[currentCount + 1] = 1; sb.append(htmControlWidth); } } sb.append(" nowrap>"); sb.append(field.getControl().produceHtml(field.getName(), "", "",field.getValidate())); sb.append(""); } if (result == columnCount) { sb.append(""); nextLine = true; currentCount = 0; } else currentCount += iColspan; } if (currentCount > 0) { int tdCount = columnCount - currentCount; for (int j = 0; j < tdCount; j++) { int index = currentCount + j; if (widthFlag[index] == 0) { widthFlag[index] = 1; widthFlag[index + 1] = 1; sb.append(""); sb.append(""); } else { sb.append("").append(""); } } sb.append(""); } sb.append("
"); String DivCss = XFormModel.getCSSValue("DivCss"); DivCss = DivCss.equals("")? "":" class=\"" + DivCss + "\""; sb.append("" + field.getLabel()).append("
"); out.print(sb.toString()); %> <% PageRootImpl PageRoot = (PageRootImpl)FormCollectionClone.getPageRoot(); %>
<% sb = new StringBuffer(); ArrayList alAction = PageRoot.getAllActions(); if(PageRoot.isImage()){ for (int i = 0; i < alAction.size(); i++) { Action action = (Action)alAction.get(i); sb.append("").append(action.appendSpace()); } }else{ for (int i = 0; i < alAction.size(); i++) { Action action = (Action)alAction.get(i); String buttonValue = action.getValue(); String dojoType = XFormModelImpl.getInstance().getJsFunctionByCode(action.getDojoType()); sb.append("").append(action.appendSpace()); action = null; } out.print(sb.toString()); } %>