select.jsp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page language="java"
  3. import="com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
  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.collectmodel.xmlmodel.impl.ReportFieldImpl,
  9. com.sysmodel.xformmodel.able.Validate,
  10. com.sysmodel.xformmodel.impl.DojoInputTypeImpl,
  11. com.sysmodel.XFormModelImpl
  12. "%>
  13. <%
  14. String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
  15. String name = request.getParameter("name") == null ? "" : request.getParameter("name");
  16. String action = "add";
  17. SysModel sysmodel = ModelFactory.getSysmodel();
  18. FormCollection FormCollection = null;
  19. ArrayList reportFields = null;
  20. int columnCount = 0;
  21. String label = "";
  22. String colspan = "";
  23. String need = "";
  24. String dojoInuptType = "";
  25. if(session.getAttribute("FormCollect"+pageid) == null ){
  26. return;
  27. } else {
  28. FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
  29. reportFields = FormCollection.getReportFieldByControlType( FormCollection , "select");
  30. columnCount = FormCollection.getPageBody().getColumnCount();
  31. if(!name.equals("")){
  32. action = "edit";
  33. ReportFieldImpl ReportFieldImpl = FormCollection.getReportFieldByName(FormCollection,name);
  34. label = ReportFieldImpl.getLabel();
  35. colspan = ReportFieldImpl.getColspan()+"";
  36. Validate Validate = ReportFieldImpl.getValidate();
  37. if(Validate!=null){
  38. need = new Boolean(Validate.isNeed()).toString();
  39. dojoInuptType = Validate.getDojoType();
  40. }
  41. }
  42. }
  43. %>
  44. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  45. <html>
  46. <head>
  47. <title>定义下拉列表构件</title>
  48. <meta http-equiv="pragma" content="no-cache">
  49. <meta http-equiv="cache-control" content="no-cache">
  50. <meta http-equiv="expires" content="0">
  51. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  52. <meta http-equiv="description" content="定义下拉列表构件">
  53. <script type="text/javascript" src="../../../scripts/creatselect.js"></script>
  54. <link rel="stylesheet" href="../../../styles/css.css" type="text/css"></link>
  55. <link rel="stylesheet" href="../../../styles/style.css" type="text/css"></link>
  56. <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  57. <script type="text/javascript">
  58. dojo.require("dijit.form.Form");
  59. dojo.require("dijit.form.ValidationTextBox");
  60. dojo.require("dijit.form.ComboBox");
  61. dojo.require("dijit.form.FilteringSelect");
  62. dojo.require("dijit.form.NumberSpinner");
  63. dojo.require("dijit.form.Button");
  64. dojo.require("dijit.Tooltip");
  65. dojo.require("dojo.parser");
  66. </script>
  67. <style type="text/css">
  68. @import "../../../scripts/dojo/dojo/resources/dojo.css";
  69. @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  70. @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  71. @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  72. .formQuestion {
  73. background-color:#d0e3f5;
  74. padding:0.3em;
  75. font-weight:900;
  76. font-family:Verdana, Arial, sans-serif;
  77. font-size:0.8em;
  78. color:#5a5a5a;
  79. }
  80. .formAnswer {
  81. background-color:#f5eede;
  82. padding:0.3em;
  83. margin-bottom:1em;
  84. width: 100%;
  85. }
  86. .pageSubContentTitle {
  87. color:#8e8e8e;
  88. font-size:1em;
  89. font-family:Verdana, Arial, sans-serif;
  90. margin-bottom:0.75em;
  91. }
  92. .small INPUT {
  93. width: 2.5em;
  94. }
  95. .medium INPUT {
  96. width: 10em;
  97. }
  98. .long INPUT {
  99. width: 20em;
  100. }
  101. .firstLabel {
  102. display: inline-block;
  103. display: -moz-inline-box;
  104. width: 10em;
  105. min-width: 10em;
  106. }
  107. .secondLabel {
  108. width: auto;
  109. margin-left: 5em;
  110. margin-right: 1em;
  111. }
  112. fieldset label {
  113. margin-right: 1em;
  114. }
  115. .noticeMessage {
  116. display: block;
  117. float: right;
  118. font-weight: normal;
  119. font-family:Arial, Verdana, sans-serif;
  120. color:#663;
  121. font-size:0.9em;
  122. }
  123. </style>
  124. </head>
  125. <body class="tundra">
  126. <form name="form1" method="post" action="selectExc.jsp">
  127. <input type="hidden" name="pageid" value="<%=pageid %>">
  128. <input type="hidden" name="action" value="<%=action %>">
  129. <input type="hidden" name="oName" value="<%=name %>">
  130. <div id=total>
  131. <div class="whiteborder">
  132. <div class="titback">
  133. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24"/></div>
  134. <div class="dropshadow">定义下拉列表构件</div>
  135. <div class="clear"></div>
  136. </div>
  137. <div class="report">
  138. <table border="0" align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  139. <tr class="">
  140. <td>字段</td>
  141. <td align="left" >
  142. <select id="name" name="name"
  143. dojoType="dijit.form.FilteringSelect"
  144. required="true"
  145. autocomplete="true">
  146. <option value="0" selected></option>
  147. <%if(name.equals("")){
  148. ArrayList mdpAttributes = FormCollection.getReportFieldContrastAttribute(FormCollection,"select");
  149. for (int i=0 ; i< mdpAttributes.size() ; i++){
  150. MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl)mdpAttributes.get(i);
  151. %>
  152. <option value="<%=MdpAttributeImpl.getName() %>"><%=MdpAttributeImpl.getDescription()%></option>
  153. <%}
  154. }else{
  155. ArrayList allAttributes = FormCollection.getAllReportFieldContrastAttribute(FormCollection,"select");
  156. for (int i=0 ; i< allAttributes.size() ; i++){
  157. MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl)allAttributes.get(i);
  158. %>
  159. <option value="<%=MdpAttributeImpl.getName() %>" <%if(MdpAttributeImpl.getName().equals(name) )out.print("selected");%>><%=MdpAttributeImpl.getDescription()%></option>
  160. <% }
  161. }
  162. %>
  163. </select>
  164. </td>
  165. </tr>
  166. <tr class="">
  167. <td>标题</td>
  168. <td align="left">
  169. <input type="text" value="<%=label %>"
  170. id="label" name="label" class="medium"
  171. dojoType="dijit.form.ValidationTextBox"
  172. required="true"
  173. ucfirst="true"
  174. invalidMessage="标题必须填写!">
  175. </td>
  176. </tr>
  177. <tr class="">
  178. <td>合并值</td>
  179. <td align="left" >
  180. <select id="colspan" name="colspan"
  181. dojoType="dijit.form.FilteringSelect"
  182. required="true"
  183. autocomplete="true">
  184. <option value="" ></option>
  185. <% if(columnCount > 0){
  186. for (int i = 2 ; i<= columnCount * 2 ; i++){
  187. %>
  188. <option value="<%=i %>" <%if(colspan.equals(i+""))out.print("selected"); %>><%=i %></option>
  189. <%}} %>
  190. </select>
  191. </td>
  192. </tr>
  193. <tr class="">
  194. <td>是否必填</td>
  195. <td align="left" >
  196. <select id="need" name="need"
  197. dojoType="dijit.form.FilteringSelect"
  198. required="true"
  199. autocomplete="true">
  200. <option value="true" <%if(need.equals("true"))out.print("selected"); %>>true</option>
  201. <option value="false"<%if(need.equals("false"))out.print("selected"); %>>false</option>
  202. </select>
  203. </td>
  204. </tr>
  205. <tr class="">
  206. <td>dojo]控件类型</td>
  207. <td align="left">
  208. <select id="dojoInuptType" name="dojoInuptType"
  209. dojoType="dijit.form.FilteringSelect"
  210. required="true"
  211. autocomplete="true">
  212. <option value="0"></option>
  213. <% ArrayList dojoInuptTypes = XFormModelImpl.getInstance().getDojoInuptTypesByType("select");
  214. for(int j = 0; j<dojoInuptTypes.size(); j++){
  215. DojoInputTypeImpl DojoInputTypeImpl=(DojoInputTypeImpl)dojoInuptTypes.get(j);
  216. %>
  217. <option value="<%=DojoInputTypeImpl.getCode() %>" <%if(DojoInputTypeImpl.getCode().equals(dojoInuptType))out.print("selected");%>><%=DojoInputTypeImpl.getName() %></option>
  218. <%} %>
  219. </select>
  220. </td>
  221. </tr>
  222. </table>
  223. </div>
  224. <div class="btmbox">
  225. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="submit" iconClass="plusIcon">
  226. 保存
  227. </button>
  228. <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>&nbsp;&nbsp;
  229. <button id="reset" dojoType="dijit.form.Button" onClick='document.form1.reset();' type="button" iconClass="plusIcon">
  230. 重置
  231. </button>
  232. <span dojoType="dijit.Tooltip" connectId="save">重置按钮</span>&nbsp;&nbsp;
  233. <button id="close" dojoType="dijit.form.Button" onClick='window.close();' type="button" iconClass="plusIcon">
  234. 关闭
  235. </button>
  236. <span dojoType="dijit.Tooltip" connectId="save">关闭按钮</span>&nbsp;&nbsp;
  237. </div>
  238. </div>
  239. </div>
  240. </form>
  241. <br>
  242. </body>
  243. </html>