text.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page language="java"
  3. import="com.sysmodel.listmodel.xmlmodel.impl.FormListImpl,
  4. com.sysmodel.datamodel.xmlmodel.ModelFactory,
  5. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
  6. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  7. com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl,
  8. com.sysmodel.listmodel.xmlmodel.impl.QueryFieldImpl,
  9. com.sysmodel.xformmodel.importcontrol.TextControl,
  10. com.sysmodel.xformmodel.able.Validate,
  11. com.sysmodel.xformmodel.impl.DojoInputTypeImpl,
  12. com.sysmodel.XFormModelImpl,
  13. com.sysmodel.xformmodel.impl.RegExpImpl"%>
  14. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  15. <html>
  16. <head>
  17. <%String listid = request.getParameter("listid") == null ? "" : request.getParameter("listid");
  18. String dataName = request.getParameter("dataName") == null ? "" : request.getParameter("dataName");
  19. String label = request.getParameter("label") == null ? "" : request.getParameter("label");
  20. String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid");
  21. String maxlength="";
  22. String size ="";
  23. String readonly ="";
  24. String operator = "";
  25. String action = "add";
  26. String dojoInuptType = "";
  27. String regxValue = "";
  28. if(!dataName.equals("")&& !classid.equals("0")){
  29. action = "edit";
  30. }
  31. FormListImpl FormList = null;
  32. ArrayList QueryFields=null;
  33. ArrayList tableList = null;
  34. if(session.getAttribute("FormList"+listid) == null){
  35. return;
  36. } else {
  37. FormList = (FormListImpl)session.getAttribute("FormList"+listid);
  38. tableList = FormList.getQueryTables();
  39. QueryFields = FormList.getQueryFields();
  40. for (int i = 0 ; i < QueryFields.size() ; i++){
  41. QueryFieldImpl QueryFieldImpl = (QueryFieldImpl)QueryFields.get(i);
  42. if(QueryFieldImpl.getDataName().equals(dataName) && QueryFieldImpl.getLabel().equals(label)){
  43. TextControl TextControl = (TextControl)QueryFieldImpl.getControl();
  44. Validate Validate = QueryFieldImpl.getValidate();
  45. regxValue = Validate.getRegxValue();
  46. dojoInuptType =Validate.getDojoType();
  47. maxlength =Validate.getMaxLength();
  48. readonly = new Boolean(TextControl.isReadOnly()).toString();
  49. operator = QueryFieldImpl.getOperator();
  50. size=TextControl.getSize();
  51. }
  52. }
  53. }
  54. %>
  55. <title>定义文本框查询构件</title>
  56. <meta http-equiv="pragma" content="no-cache">
  57. <meta http-equiv="cache-control" content="no-cache">
  58. <meta http-equiv="expires" content="0">
  59. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  60. <meta http-equiv="description" content="定义文本框查询构件">
  61. <link rel="stylesheet" href="../../../styles/css.css" type="text/css"></link>
  62. <link rel="stylesheet" href="../../../styles/style.css" type="text/css"></link>
  63. <script type="text/javascript" src="../../../scripts/creatselect.js"></script>
  64. <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  65. <script type="text/javascript">
  66. dojo.require("dijit.form.Form");
  67. dojo.require("dijit.form.ValidationTextBox");
  68. dojo.require("dijit.form.ComboBox");
  69. dojo.require("dijit.form.FilteringSelect");
  70. dojo.require("dijit.form.NumberSpinner");
  71. dojo.require("dijit.form.Button");
  72. dojo.require("dijit.Tooltip");
  73. </script>
  74. <style type="text/css">
  75. @import "../../../scripts/dojo/dojo/resources/dojo.css";
  76. @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  77. @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  78. @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  79. .formQuestion {
  80. background-color:#d0e3f5;
  81. padding:0.3em;
  82. font-weight:900;
  83. font-family:Verdana, Arial, sans-serif;
  84. font-size:0.8em;
  85. color:#5a5a5a;
  86. }
  87. .formAnswer {
  88. background-color:#f5eede;
  89. padding:0.3em;
  90. margin-bottom:1em;
  91. width: 100%;
  92. }
  93. .pageSubContentTitle {
  94. color:#8e8e8e;
  95. font-size:1em;
  96. font-family:Verdana, Arial, sans-serif;
  97. margin-bottom:0.75em;
  98. }
  99. .small INPUT {
  100. width: 2.5em;
  101. }
  102. .medium INPUT {
  103. width: 10em;
  104. }
  105. .long INPUT {
  106. width: 20em;
  107. }
  108. .firstLabel {
  109. display: inline-block;
  110. display: -moz-inline-box;
  111. width: 10em;
  112. min-width: 10em;
  113. }
  114. .secondLabel {
  115. width: auto;
  116. margin-left: 5em;
  117. margin-right: 1em;
  118. }
  119. fieldset label {
  120. margin-right: 1em;
  121. }
  122. .noticeMessage {
  123. display: block;
  124. float: right;
  125. font-weight: normal;
  126. font-family:Arial, Verdana, sans-serif;
  127. color:#663;
  128. font-size:0.9em;
  129. }
  130. </style>
  131. </head>
  132. <body class="tundra">
  133. <form name="form1" method="post" action="TextExc.jsp">
  134. <input type="hidden" name="listid" value="<%=listid %>">
  135. <input type="hidden" name="oDataName" value="<%=dataName %>">
  136. <input type="hidden" name="oLabel" value="<%=label %>">
  137. <input type="hidden" name="action" value="<%=action %>">
  138. <div id=total>
  139. <div class="whiteborder">
  140. <div class="titback">
  141. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24"/></div>
  142. <div class="dropshadow">定义文本框查询构件</div>
  143. <div class="clear"></div>
  144. </div>
  145. <div class="report">
  146. <table border="0" align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  147. <tr class="">
  148. <td width="15%">表名&nbsp;<font color="red">*</font></td>
  149. <td align="left" >
  150. <select id="classid" name="classid" onChange="getTable(this,dojo.byId('dataName'),'text')"
  151. dojoType="dijit.form.FilteringSelect"
  152. autocomplete="true">
  153. <option value="0"></option>
  154. <%
  155. for(int i = 0 ; i < tableList.size(); i ++){
  156. int iclassid = Integer.parseInt((String)tableList.get(i));
  157. SysModel sysmodel = ModelFactory.getSysmodel();
  158. MdpClassImpl MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
  159. %>
  160. <option value="<%=iclassid %>" <%if(classid.equals((String)tableList.get(i)))out.print("selected"); %>><%=MdpClass.getDescription()%></option>
  161. <%}%>
  162. </select></td>
  163. </tr>
  164. <tr class="">
  165. <td>字段&nbsp;<font color="red">*</font></td>
  166. <td align="left" ><select name="dataName" id="dataName">
  167. <%
  168. if(!dataName.equals("") && (!classid.equals("0"))){
  169. SysModel sysmodel = ModelFactory.getSysmodel();
  170. MdpClassImpl MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(Integer.parseInt(classid));
  171. ArrayList list = (ArrayList)MdpClass.getAllMdpAttributes();
  172. for(int i = 0 ; i < list.size(); i ++){
  173. MdpAttributeImpl MdpAttribute = (MdpAttributeImpl) list.get(i);
  174. %>
  175. <option value="<%=MdpAttribute.getName() %>" <%if(dataName.equals(MdpAttribute.getName()))out.print("selected") ;%>><%=MdpAttribute.getDescription()%></option>
  176. <%}}%>
  177. </select></td>
  178. </tr>
  179. <tr class="">
  180. <td>标题&nbsp;<font color="red">*</font></td>
  181. <td align="left"><input type="text" id="label" name="label" class="medium"
  182. dojoType="dijit.form.ValidationTextBox"
  183. required="true"
  184. ucfirst="true"
  185. value="<%=label %>"
  186. invalidMessage="标题必须填写!"/></td>
  187. </tr>
  188. <tr class="">
  189. <td>操作类型</td>
  190. <td align="left" ><select name="operator" dojoType="dijit.form.FilteringSelect"
  191. required="true" id="operator" autocomplete="true">
  192. <option value="0"></option>
  193. <option value="like" <%if(operator.equals("like")) out.print("selected"); %> >like</option>
  194. <option value="equals" <%if(operator.equals("equals")) out.print("selected"); %>>equals</option>
  195. <option value="morethan" <%if(operator.equals("morethan")) out.print("selected"); %>>大于等于</option>
  196. <option value="lessthan" <%if(operator.equals("lessthan")) out.print("selected"); %>>小于等于</option>
  197. </select></td>
  198. </tr>
  199. <tr class="">
  200. <td>size &nbsp;<font color="red">*</font></td>
  201. <td align="left"><input type="text" id="size" name="size" class="medium"
  202. dojoType="dijit.form.ValidationTextBox"
  203. required="true"
  204. ucfirst="true"
  205. value="<%=size %>"
  206. invalidMessage="size必须填写!"/></td>
  207. </tr>
  208. <tr class="">
  209. <td>maxlength</td>
  210. <td align="left">
  211. <input type="text" id="maxlength" name="maxlength" class="medium"
  212. dojoType="dijit.form.ValidationTextBox"
  213. value="<%=maxlength %>"/>
  214. </td>
  215. </tr>
  216. <tr class="">
  217. <td>readonly</td>
  218. <td align="left">
  219. <select name="readonly" dojoType="dijit.form.FilteringSelect"
  220. required="true" id="readonly" autocomplete="true">
  221. <option value="false" <%if(readonly.equals("false")) out.print("selected");%>>false</option>
  222. <option value="true" <%if(readonly.equals("true")) out.print("selected");%>>true</option>
  223. </select>
  224. </td>
  225. </tr>
  226. <tr class="">
  227. <td>dojo]控件类型</td>
  228. <td align="left">
  229. <select id="dojoInuptType" name="dojoInuptType"
  230. dojoType="dijit.form.FilteringSelect">
  231. <option value="0">--请选择--</option>
  232. <% ArrayList dojoInuptTypes = XFormModelImpl.getInstance().getDojoInuptTypesByType("text");
  233. for(int m = 0; m<dojoInuptTypes.size(); m++){
  234. DojoInputTypeImpl DojoInputTypeImpl=(DojoInputTypeImpl)dojoInuptTypes.get(m);
  235. %>
  236. <option value="<%=DojoInputTypeImpl.getCode() %>" <%if(DojoInputTypeImpl.getCode().equals(dojoInuptType))out.print("selected");%>><%=DojoInputTypeImpl.getName() %></option>
  237. <%} %>
  238. </select>
  239. </td>
  240. </tr>
  241. <tr class="">
  242. <td>正则表达式</td>
  243. <td align="left"><select id="regxValue" name="regxValue"
  244. dojoType="dijit.form.FilteringSelect">
  245. <option value="0">--请选择--</option>
  246. <% ArrayList regExps=XFormModelImpl.getInstance().getRegExps();
  247. for(int j = 0; j<regExps.size(); j++){
  248. RegExpImpl RegExpImpl=(RegExpImpl)regExps.get(j);
  249. %>
  250. <option value="<%=RegExpImpl.getCode() %>" <%if(RegExpImpl.getCode().equals(regxValue))out.print("selected");%>><%=RegExpImpl.getName() %></option>
  251. <%} %>
  252. </select></td>
  253. </tr>
  254. </table>
  255. </div>
  256. <div class="btmbox">
  257. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="submit" iconClass="plusIcon">
  258. 保存
  259. </button>
  260. <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>&nbsp;&nbsp;
  261. <button id="re" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="reset" iconClass="plusIcon">
  262. 重置
  263. </button>
  264. <span dojoType="dijit.Tooltip" connectId="re">重置按钮</span>&nbsp;&nbsp;
  265. <button id="clo" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),window.close();' type="button" iconClass="plusIcon">
  266. 关闭
  267. </button>
  268. <span dojoType="dijit.Tooltip" connectId="clo">关闭按钮</span>&nbsp;&nbsp;
  269. </div>
  270. </div>
  271. </div>
  272. </form>
  273. <br>
  274. </body>
  275. </html>