checkBox.jsp 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page language="java"
  3. import="java.util.*,
  4. com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
  5. com.sysmodel.datamodel.xmlmodel.ModelFactory,
  6. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
  7. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  8. com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl,
  9. com.sysmodel.collectmodel.xmlmodel.impl.ReportFieldImpl,
  10. com.sysmodel.xformmodel.importcontrol.CheckBoxControl,
  11. com.sysmodel.xformmodel.able.Validate,
  12. com.sysmodel.xformmodel.impl.DojoInputTypeImpl,
  13. com.sysmodel.XFormModelImpl
  14. "%>
  15. <%
  16. String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
  17. String name = request.getParameter("name") == null ? "" : request.getParameter("name");
  18. String action = "add";
  19. SysModel sysmodel = ModelFactory.getSysmodel();
  20. FormCollection FormCollection = null;
  21. ArrayList reportFields = null;
  22. int columnCount = 0;
  23. String label = "";
  24. String colspan = "";
  25. String need = "";
  26. String singleLine = "";
  27. String dojoInuptType = "";
  28. if(session.getAttribute("FormCollect"+pageid) == null ){
  29. return;
  30. } else {
  31. FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
  32. reportFields = FormCollection.getReportFieldByControlType( FormCollection , "date");
  33. columnCount = FormCollection.getPageBody().getColumnCount();
  34. if(!name.equals("")){
  35. action = "edit";
  36. ReportFieldImpl ReportFieldImpl = FormCollection.getReportFieldByName(FormCollection,name);
  37. label = ReportFieldImpl.getLabel();
  38. colspan = ReportFieldImpl.getColspan()+"";
  39. Validate Validate = ReportFieldImpl.getValidate();
  40. if(Validate!=null){
  41. need = new Boolean(Validate.isNeed()).toString();
  42. dojoInuptType = Validate.getDojoType();
  43. }
  44. CheckBoxControl CheckBoxControl = (CheckBoxControl)ReportFieldImpl.getControl();
  45. if(CheckBoxControl!=null){
  46. singleLine = new Boolean(CheckBoxControl.isSingleLine()).toString();
  47. }
  48. }
  49. }
  50. %>
  51. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  52. <html>
  53. <head>
  54. <title>定义复选框采集构件</title>
  55. <meta http-equiv="pragma" content="no-cache">
  56. <meta http-equiv="cache-control" content="no-cache">
  57. <meta http-equiv="expires" content="0">
  58. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  59. <meta http-equiv="description" content="定义复选框采集构件">
  60. <script type="text/javascript" src="../../../scripts/creatselect.js"></script>
  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/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  64. <script type="text/javascript">
  65. dojo.require("dijit.form.Form");
  66. dojo.require("dijit.form.ValidationTextBox");
  67. dojo.require("dijit.form.ComboBox");
  68. dojo.require("dijit.form.FilteringSelect");
  69. dojo.require("dijit.form.NumberSpinner");
  70. dojo.require("dijit.form.Button");
  71. dojo.require("dijit.Tooltip");
  72. dojo.require("dojo.parser");
  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="checkBoxExc.jsp">
  134. <input type="hidden" name="pageid" value="<%=pageid %>">
  135. <input type="hidden" name="action" value="<%=action %>">
  136. <input type="hidden" name="oName" value="<%=name %>">
  137. <div id=total>
  138. <div class="whiteborder">
  139. <div class="titback">
  140. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24"/></div>
  141. <div class="dropshadow">定义复选框采集构件</div>
  142. <div class="clear"></div>
  143. </div>
  144. <div class="report">
  145. <table border="0" align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  146. <tr class="">
  147. <td>字段</td>
  148. <td align="left" >
  149. <select id="name" name="name"
  150. dojoType="dijit.form.FilteringSelect"
  151. required="true"
  152. autocomplete="true">
  153. <option value="0" selected></option>
  154. <%if(name.equals("")){
  155. ArrayList mdpAttributes = FormCollection.getReportFieldContrastAttribute(FormCollection,"checkbox");
  156. for (int i=0 ; i< mdpAttributes.size() ; i++){
  157. MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl)mdpAttributes.get(i);
  158. %>
  159. <option value="<%=MdpAttributeImpl.getName() %>"><%=MdpAttributeImpl.getDescription()%></option>
  160. <%}
  161. }else{
  162. ArrayList allAttributes = FormCollection.getAllReportFieldContrastAttribute(FormCollection,"checkbox");
  163. for (int i=0 ; i< allAttributes.size() ; i++){
  164. MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl)allAttributes.get(i);
  165. %>
  166. <option value="<%=MdpAttributeImpl.getName() %>" <%if(MdpAttributeImpl.getName().equals(name) )out.print("selected");%>><%=MdpAttributeImpl.getDescription()%></option>
  167. <% }
  168. }
  169. %>
  170. </select>
  171. </td>
  172. </tr>
  173. <tr class="">
  174. <td>标题</td>
  175. <td align="left">
  176. <input type="text" value="<%=label %>"
  177. id="label" name="label" class="medium"
  178. dojoType="dijit.form.ValidationTextBox"
  179. required="true"
  180. ucfirst="true"
  181. invalidMessage="标题必须填写!">
  182. </td>
  183. </tr>
  184. <tr class="">
  185. <td>合并值</td>
  186. <td align="left" >
  187. <select id="colspan" name="colspan"
  188. dojoType="dijit.form.FilteringSelect"
  189. required="true"
  190. autocomplete="true">
  191. <option value="" ></option>
  192. <% if(columnCount > 0){
  193. for (int i = 2 ; i<= columnCount * 2 ; i++){
  194. %>
  195. <option value="<%=i %>" <%if(colspan.equals(i+""))out.print("selected"); %>><%=i %></option>
  196. <%}} %>
  197. </select>
  198. </td>
  199. </tr>
  200. <tr class="">
  201. <td>是否必填</td>
  202. <td align="left" >
  203. <select id="need" name="need"
  204. dojoType="dijit.form.FilteringSelect"
  205. required="true"
  206. autocomplete="true">
  207. <option value="true" <%if(need.equals("true"))out.print("selected"); %>>true</option>
  208. <option value="false"<%if(need.equals("false"))out.print("selected"); %>>false</option>
  209. </select>
  210. </td>
  211. </tr>
  212. <tr class="">
  213. <td>singleLine</td>
  214. <td align="left">
  215. <select id="singleLine" name="singleLine"
  216. dojoType="dijit.form.FilteringSelect"
  217. required="true"
  218. autocomplete="true">
  219. <option value="true" <%if(singleLine.equals("true"))out.print("selected"); %>>true</option>
  220. <option value="false"<%if(singleLine.equals("false"))out.print("selected"); %>>false</option>
  221. </select>
  222. </td>
  223. </tr>
  224. <tr class="">
  225. <td>dojo]控件类型</td>
  226. <td align="left">
  227. <select id="dojoInuptType" name="dojoInuptType"
  228. dojoType="dijit.form.FilteringSelect"
  229. required="true"
  230. autocomplete="true">
  231. <option value="0"></option>
  232. <% ArrayList dojoInuptTypes = XFormModelImpl.getInstance().getDojoInuptTypesByType("checkbox");
  233. for(int j = 0; j<dojoInuptTypes.size(); j++){
  234. DojoInputTypeImpl DojoInputTypeImpl=(DojoInputTypeImpl)dojoInuptTypes.get(j);
  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. </table>
  242. </div>
  243. <div class="btmbox">
  244. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="submit" iconClass="plusIcon">
  245. 保存
  246. </button>
  247. <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>&nbsp;&nbsp;
  248. <button id="reset" dojoType="dijit.form.Button" onClick='document.form1.reset();' type="button" iconClass="plusIcon">
  249. 重置
  250. </button>
  251. <span dojoType="dijit.Tooltip" connectId="save">重置按钮</span>&nbsp;&nbsp;
  252. <button id="close" dojoType="dijit.form.Button" onClick='window.close();' type="button" iconClass="plusIcon">
  253. 关闭
  254. </button>
  255. <span dojoType="dijit.Tooltip" connectId="save">关闭按钮</span>&nbsp;&nbsp;
  256. </div>
  257. </div>
  258. </div>
  259. </form>
  260. <br>
  261. </body>
  262. </html>