buttonSort.jsp 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <%@ page language="java" pageEncoding="UTF-8"%>
  2. <%@ page language="java"
  3. import="java.util.ArrayList,
  4. com.sysmodel.collectmodel.xmlmodel.impl.FormCollectionImpl,
  5. com.sysmodel.collectmodel.xmlmodel.impl.ActionImpl"%>
  6. <%
  7. String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
  8. FormCollectionImpl FormCollect = null;
  9. ArrayList actions=null;
  10. if(session.getAttribute("FormCollect"+pageid) == null){
  11. return;
  12. } else {
  13. FormCollect = (FormCollectionImpl)session.getAttribute("FormCollect"+pageid);
  14. actions=FormCollect.getPageRoot().getAllActions();
  15. }
  16. %>
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  18. <html>
  19. <head>
  20. <title>采集字段排序页面</title>
  21. <meta http-equiv="pragma" content="no-cache">
  22. <meta http-equiv="cache-control" content="no-cache">
  23. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  24. <meta http-equiv="expires" content="0">
  25. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  26. <meta http-equiv="description" content="This is my page">
  27. <link rel="stylesheet" href="../../../styles/style.css" type="text/css"></link>
  28. <link rel="stylesheet" href="../../../styles/css.css" type="text/css"></link>
  29. <script type="text/javascript">
  30. function remove(flag){
  31. var sort = document.getElementById("sort");
  32. if(sort.selectedIndex !=-1){
  33. for(var selIndex=0; selIndex < sort.options.length; selIndex ++){
  34. if(sort.options[selIndex].selected){
  35. var value = sort.options[selIndex].value;
  36. var text = sort.options[selIndex].text;
  37. if (flag == '1'){
  38. if(selIndex != 0){
  39. var value1 = sort.options[selIndex-1].value;
  40. var text1 = sort.options[selIndex-1].text;
  41. sort.options[selIndex].value = value1;
  42. sort.options[selIndex].text = text1;
  43. sort.options[selIndex-1].value = value;
  44. sort.options[selIndex-1].text = text;
  45. sort.selectedIndex = sort.selectedIndex - 1;
  46. }
  47. }else if (flag == '0') {
  48. var max = sort.options.length - 1;
  49. if(selIndex != max){
  50. var value2 = sort.options[selIndex+1].value;
  51. var text2 = sort.options[selIndex+1].text;
  52. sort.options[selIndex].value = value2;
  53. sort.options[selIndex].text = text2;
  54. sort.options[selIndex+1].value = value;
  55. sort.options[selIndex+1].text = text;
  56. sort.selectedIndex = sort.selectedIndex + 1;
  57. return;
  58. }
  59. }
  60. }
  61. }
  62. }
  63. }
  64. function getAllOptions(){
  65. var sort = document.getElementById("sort");
  66. var url = "";
  67. for(var selIndex = 0; selIndex < sort.options.length; selIndex ++){
  68. url = url + selIndex + "=" + sort.options[selIndex].value + "&";
  69. }
  70. url = url + "pageid=<%=pageid%>";
  71. alert(url)
  72. document.location.href = "buttonSortExc.jsp?" + url;
  73. }
  74. </script>
  75. <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  76. <script type="text/javascript">
  77. dojo.require("dijit.form.Form");
  78. dojo.require("dijit.form.ValidationTextBox");
  79. dojo.require("dijit.form.ComboBox");
  80. dojo.require("dijit.form.FilteringSelect");
  81. dojo.require("dijit.form.NumberSpinner");
  82. dojo.require("dijit.form.Button");
  83. dojo.require("dijit.Tooltip");
  84. </script>
  85. <style type="text/css">
  86. @import "../../../scripts/dojo/dojo/resources/dojo.css";
  87. @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  88. @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  89. @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  90. .formQuestion {
  91. background-color:#d0e3f5;
  92. padding:0.3em;
  93. font-weight:900;
  94. font-family:Verdana, Arial, sans-serif;
  95. font-size:0.8em;
  96. color:#5a5a5a;
  97. }
  98. .formAnswer {
  99. background-color:#f5eede;
  100. padding:0.3em;
  101. margin-bottom:1em;
  102. width: 100%;
  103. }
  104. .pageSubContentTitle {
  105. color:#8e8e8e;
  106. font-size:1em;
  107. font-family:Verdana, Arial, sans-serif;
  108. margin-bottom:0.75em;
  109. }
  110. .small INPUT {
  111. width: 2.5em;
  112. }
  113. .medium INPUT {
  114. width: 10em;
  115. }
  116. .long INPUT {
  117. width: 20em;
  118. }
  119. .firstLabel {
  120. display: inline-block;
  121. display: -moz-inline-box;
  122. width: 10em;
  123. min-width: 10em;
  124. }
  125. .secondLabel {
  126. width: auto;
  127. margin-left: 5em;
  128. margin-right: 1em;
  129. }
  130. fieldset label {
  131. margin-right: 1em;
  132. }
  133. .noticeMessage {
  134. display: block;
  135. float: right;
  136. font-weight: normal;
  137. font-family:Arial, Verdana, sans-serif;
  138. color:#663;
  139. font-size:0.9em;
  140. }
  141. </style>
  142. </head>
  143. <body class="tundra">
  144. <form name="form1" method="post" action="buttonSortExc.jsp">
  145. <div id="hiddenDiv" />
  146. </div>
  147. <div id=total>
  148. <div class="whiteborder">
  149. <div class="titback">
  150. <div class="floatleft"><img src="../../../images/index/arrow1.gif" alt="1" width="20" height="24" /></div>
  151. <div class="dropshadow">按钮排序</div>
  152. <div class="clear"></div>
  153. </div>
  154. <div class="report">
  155. <table align="center" id="SortTable512_1" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  156. <tr>
  157. <td width="60%"><table align="center" width="100%" border="0" cellpadding="1" cellspacing="1" class="ltab2" >
  158. <tr class="TableBgColorAsh">
  159. <td width="40%" align="center">
  160. <select id="sort" name="dataName" size="15" style="width:80%" ondblclick="" class="SelectBgcolor">
  161. <%
  162. for(int i = 0 ; i < actions.size(); i ++){
  163. ActionImpl ActionImpl = (ActionImpl)actions.get(i);
  164. %>
  165. <option value="<%=ActionImpl.getType() %>" ><%=ActionImpl.getValue() %></option>
  166. <%}%>
  167. </select></td>
  168. <td width="20%" align="center"> <button id="top" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),remove("1")' type="button" iconClass="plusIcon">
  169. </button>
  170. <br>
  171. <br>
  172. <button id="down" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),remove("0")' type="button" iconClass="plusIcon">
  173. </button>
  174. </td>
  175. </tr>
  176. </table></td>
  177. </tr>
  178. </table>
  179. </div>
  180. <div class="btmbox">
  181. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),getAllOptions();'iconClass="plusIcon">
  182. 提交
  183. </button>&nbsp;&nbsp;
  184. <span dojoType="dijit.Tooltip" connectId="save">提交按钮</span>&nbsp;&nbsp;
  185. <button id="re" dojoType="dijit.form.Button" onClick="document.form1.reset()"iconClass="plusIcon">
  186. 重置
  187. </button>
  188. <span dojoType="dijit.Tooltip" connectId="re">重置按钮</span>&nbsp;&nbsp;
  189. <button id="clo" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),window.close();' iconClass="plusIcon">
  190. 关闭
  191. </button>
  192. <span dojoType="dijit.Tooltip" connectId="clo">关闭按钮</span>&nbsp;&nbsp;
  193. </div>
  194. </div>
  195. </div>
  196. </form>
  197. </body>
  198. </html>