textarea.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page language="java"
  3. import="java.util.*,
  4. com.sysmodel.XFormFactory,
  5. com.sysmodel.collectmodel.xmlmodel.impl.FormCollectionImpl,
  6. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
  7. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  8. com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl,
  9. com.sysmodel.datamodel.xmlmodel.ModelFactory,
  10. com.sysmodel.collectmodel.xmlmodel.impl.ReportFieldImpl,
  11. com.sysmodel.xformmodel.importcontrol.TextAreaControl,
  12. com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
  13. com.sysmodel.xformmodel.impl.RegExpImpl,
  14. com.sysmodel.XFormModelImpl,
  15. com.sysmodel.xformmodel.able.Validate,
  16. com.sysmodel.xformmodel.impl.DojoInputTypeImpl"%>
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  18. <html>
  19. <head>
  20. <% String pageid=request.getParameter("pageid")==null ? "0" : request.getParameter("pageid");
  21. String name = request.getParameter("name") == null ? "" : request.getParameter("name");
  22. String action="add";
  23. String label="";
  24. String colspan="";
  25. String maxlengths="";
  26. String promptMessage="";
  27. String invalidMessage="";
  28. String need="";
  29. String trime="";
  30. String regxValue = "";
  31. String max="";
  32. String min="";
  33. String dojoInuptType = "";
  34. int columnCount = 0;
  35. FormCollection FormCollection =null;
  36. if(session.getAttribute("FormCollect"+pageid) == null){
  37. return;
  38. } else {
  39. FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
  40. columnCount = FormCollection.getPageBody().getColumnCount();
  41. if(!name.equals("")){
  42. action="edit";
  43. ReportFieldImpl ReportFieldImpl = FormCollection.getReportFieldByName(FormCollection,name);
  44. label=ReportFieldImpl.getLabel();
  45. colspan=ReportFieldImpl.getColspan()+"";
  46. Validate Validate = ReportFieldImpl.getValidate();
  47. need = new Boolean(Validate.isNeed()).toString();
  48. trime = new Boolean(Validate.isTrim()).toString();
  49. invalidMessage = Validate.getInvalidMessage();
  50. promptMessage = Validate.getPromptMessage();
  51. regxValue = Validate.getRegxValue();
  52. maxlengths=Validate.getMaxLength();
  53. max=Validate.getMaxValue();
  54. min=Validate.getMinValue();
  55. dojoInuptType=Validate.getDojoType();
  56. }
  57. FormCollection=(FormCollectionImpl)session.getAttribute("FormCollect"+pageid);
  58. }
  59. %>
  60. <title>定义文本框查询构件</title>
  61. <meta http-equiv="pragma" content="no-cache">
  62. <meta http-equiv="cache-control" content="no-cache">
  63. <meta http-equiv="expires" content="0">
  64. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  65. <meta http-equiv="description" content="定义文本框查询构件">
  66. <link rel="stylesheet" href="../../../styles/css.css" type="text/css"></link>
  67. <link rel="stylesheet" href="../../../styles/style.css" type="text/css"></link>
  68. <script type="text/javascript">
  69. function checkinput(){
  70. document.forms[0].submit();
  71. }
  72. </script>
  73. <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  74. <script type="text/javascript">
  75. dojo.require("dijit.form.Form");
  76. dojo.require("dijit.form.ValidationTextBox");
  77. dojo.require("dijit.form.ComboBox");
  78. dojo.require("dijit.form.FilteringSelect");
  79. dojo.require("dijit.form.NumberSpinner");
  80. dojo.require("dijit.form.Button");
  81. dojo.require("dijit.Tooltip");
  82. dojo.require("dojo.parser");
  83. </script>
  84. <style type="text/css">
  85. @import "../../../scripts/dojo/dojo/resources/dojo.css";
  86. @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  87. @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  88. @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  89. .formQuestion {
  90. background-color:#d0e3f5;
  91. padding:0.3em;
  92. font-weight:900;
  93. font-family:Verdana, Arial, sans-serif;
  94. font-size:0.8em;
  95. color:#5a5a5a;
  96. }
  97. .formAnswer {
  98. background-color:#f5eede;
  99. padding:0.3em;
  100. margin-bottom:1em;
  101. width: 100%;
  102. }
  103. .pageSubContentTitle {
  104. color:#8e8e8e;
  105. font-size:1em;
  106. font-family:Verdana, Arial, sans-serif;
  107. margin-bottom:0.75em;
  108. }
  109. .small INPUT {
  110. width: 2.5em;
  111. }
  112. .medium INPUT {
  113. width: 10em;
  114. }
  115. .long INPUT {
  116. width: 20em;
  117. }
  118. .firstLabel {
  119. display: inline-block;
  120. display: -moz-inline-box;
  121. width: 10em;
  122. min-width: 10em;
  123. }
  124. .secondLabel {
  125. width: auto;
  126. margin-left: 5em;
  127. margin-right: 1em;
  128. }
  129. fieldset label {
  130. margin-right: 1em;
  131. }
  132. .noticeMessage {
  133. display: block;
  134. float: right;
  135. font-weight: normal;
  136. font-family:Arial, Verdana, sans-serif;
  137. color:#663;
  138. font-size:0.9em;
  139. }
  140. </style>
  141. </head>
  142. <body class="tundra">
  143. <form name="form1" method="post" action="textareaExc.jsp">
  144. <input type="hidden" name="pageid" value="<%=pageid %>">
  145. <input type="hidden" name="action" value="<%=action %>">
  146. <input type="hidden" name="oname" value="<%=name %>">
  147. <div id=total>
  148. <div class="whiteborder">
  149. <div class="titback">
  150. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24"/></div>
  151. <div class="dropshadow">定义文本框采集构件</div>
  152. <div class="clear"></div>
  153. </div>
  154. <div class="report">
  155. <table border="0" align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  156. <tr class="">
  157. <td width="15%">字段</td>
  158. <td align="left" >
  159. <select id="name" name="name"
  160. dojoType="dijit.form.FilteringSelect"
  161. required="true"
  162. autocomplete="true">
  163. <option value="0">--请选择--</option>
  164. <%ArrayList ReportFields=FormCollection.getAllReportFields();
  165. SysModel sysmodel = ModelFactory.getSysmodel();
  166. int iclassid = Integer.parseInt(FormCollection.getClassid());
  167. MdpClassImpl MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
  168. List MdpAttributes=MdpClass.getAllMdpAttributes();
  169. for(int j=0; j<MdpAttributes.size(); j++){
  170. MdpAttributeImpl MdpAttributeImpl=(MdpAttributeImpl)MdpAttributes.get(j);
  171. String name1=MdpAttributeImpl.getName();
  172. String Description=MdpAttributeImpl.getDescription();
  173. String referenceType=MdpAttributeImpl.getReferenceType()+"";//tree
  174. String DataType=MdpAttributeImpl.getDataType();
  175. boolean isshow=true;
  176. for(int i=0; i<ReportFields.size(); i++){
  177. ReportFieldImpl ReportField=(ReportFieldImpl)ReportFields.get(i);
  178. String name2=ReportField.getName();
  179. if(name1.equals(name2)||!referenceType.equals("0")||DataType.equals("date")){
  180. isshow=false;
  181. continue;
  182. }
  183. }if(isshow){
  184. %>
  185. <option value="<%=name1 %>"><%=Description%></option>
  186. <% }if(name1.equals(name) ){%>
  187. <option value="<%=name1 %>" selected><%=Description%></option>
  188. <%}
  189. }%>
  190. </select></td>
  191. </tr>
  192. <tr class="">
  193. <td>标题</td>
  194. <td align="left">
  195. <input type="text" value="<%=label %>"
  196. id="label" name="label" class="medium"
  197. dojoType="dijit.form.ValidationTextBox"
  198. required="true"
  199. ucfirst="true"
  200. invalidMessage="标题必须填写!"></td>
  201. </tr>
  202. <tr class="">
  203. <td>合并值</td>
  204. <td align="left"> <select id="colspan" name="colspan"
  205. dojoType="dijit.form.FilteringSelect"
  206. required="true"
  207. autocomplete="true">
  208. <option value="" >--请选择--</option>
  209. <%
  210. if(columnCount > 0){
  211. for (int i = 2 ; i<= columnCount * 2 ; i++){
  212. %>
  213. <option value="<%=i %>" <%if(colspan.equals(i+""))out.print("selected"); %>><%=i %></option>
  214. <%}} %>
  215. </select></td>
  216. </tr>
  217. <tr class="">
  218. <td>录入提示</td>
  219. <td align="left">
  220. <input type="text" value="<%=promptMessage %>"
  221. id="promptMessage" name="promptMessage" class="medium"
  222. dojoType="dijit.form.ValidationTextBox"
  223. required="false"
  224. ucfirst="true"
  225. invalidMessage="">
  226. </td>
  227. </tr><tr class="">
  228. <td>验证失败提示</td>
  229. <td align="left"><input type="text" value="<%=invalidMessage %>"
  230. id="invalidMessage" name="invalidMessage" class="medium"
  231. dojoType="dijit.form.ValidationTextBox"
  232. required="false"
  233. ucfirst="true"
  234. invalidMessage=""></td>
  235. </tr>
  236. </table>
  237. <table align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  238. <tr class="TableBgColorBlack">
  239. <td colspan="4" align="left"><strong>录入验证</strong></td>
  240. </tr>
  241. <tr class="">
  242. <td>是否必填&nbsp;<font color="red">*</font></td>
  243. <td align="left" >
  244. <select id="need" name="need"
  245. dojoType="dijit.form.FilteringSelect"
  246. required="true"
  247. autocomplete="true">
  248. <option value="true" <%if(need.equals("true"))out.print("selected"); %>>true</option>
  249. <option value="false"<%if(need.equals("false"))out.print("selected"); %>>false</option>
  250. </select>
  251. </td>
  252. </tr>
  253. <tr class="">
  254. <td>是否去掉空格</td>
  255. <td align="left" >
  256. <select id="trime" name="trime"
  257. dojoType="dijit.form.FilteringSelect"
  258. required="true"
  259. autocomplete="true">
  260. <option value="true" <%if(trime.equals("false"))out.print("selected"); %>>true</option>
  261. <option value="false" <%if(trime.equals("false"))out.print("selected"); %>>false</option>
  262. </select>
  263. </td>
  264. </tr>
  265. <tr class="">
  266. <td>dojo]控件类型</td>
  267. <td align="left">
  268. <select id="dojoInuptType" name="dojoInuptType"
  269. dojoType="dijit.form.FilteringSelect"
  270. required="true"
  271. autocomplete="true">
  272. <option value="0">--请选择--</option>
  273. <% ArrayList dojoInuptTypes = XFormModelImpl.getInstance().getDojoInuptTypesByType("textarea");
  274. for(int m = 0; m<dojoInuptTypes.size(); m++){
  275. DojoInputTypeImpl DojoInputTypeImpl=(DojoInputTypeImpl)dojoInuptTypes.get(m);
  276. %>
  277. <option value="<%=DojoInputTypeImpl.getCode() %>" <%if(DojoInputTypeImpl.getCode().equals(dojoInuptType))out.print("selected");%>><%=DojoInputTypeImpl.getName() %></option>
  278. <%} %>
  279. </select>
  280. </td>
  281. </tr>
  282. <tr class="">
  283. <td>输入最大值</td>
  284. <td align="left"><input type="text" name="maxlengths" value="<%=maxlengths%>" dojoType="dijit.form.ValidationTextBox"></td>
  285. </tr>
  286. </table>
  287. </div>
  288. <div class="btmbox">
  289. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),checkinput()' type="button" iconClass="plusIcon">
  290. 保存
  291. </button>
  292. <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>&nbsp;&nbsp;
  293. <button id="re" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),document.form1.reset();' iconClass="plusIcon">
  294. 重置
  295. </button>
  296. <span dojoType="dijit.Tooltip" connectId="re">重置按钮</span>&nbsp;&nbsp;
  297. <button id="clo" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),window.close();' type="button" iconClass="plusIcon">
  298. 关闭
  299. </button>
  300. <span dojoType="dijit.Tooltip" connectId="clo">关闭按钮</span>&nbsp;&nbsp;
  301. </div>
  302. </div>
  303. </div>
  304. </form>
  305. <br>
  306. </body>
  307. </html>