radio.jsp 9.7 KB

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