f6f4ba240b803340e3ddc601acf31d33c7b8be6d.svn-base 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@taglib uri="/struts-tags" prefix="s"%>
  3. <%
  4. String path = request.getContextPath();
  5. %>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  10. <title>用户信息</title>
  11. <!--框架必需start-->
  12. <script type="text/javascript" src="<%=path%>/libs/js/jquery.js"></script>
  13. <script type="text/javascript" src="<%=path%>/libs/js/language/cn.js"></script>
  14. <script type="text/javascript" src="<%=path%>/libs/js/framework.js"></script>
  15. <link href="<%=path%>/libs/css/import_basic.css" rel="stylesheet" type="text/css" />
  16. <link rel="stylesheet" type="text/css" id="skin" prePath="<%=path%>/" />
  17. <link rel="stylesheet" type="text/css" id="customSkin"/>
  18. <!--框架必需end-->
  19. <!-- 树组件start -->
  20. <script type="text/javascript" src="<%=path%>/libs/js/tree/ztree/ztree.js"></script>
  21. <link type="text/css" rel="stylesheet" href="<%=path%>/libs/js/tree/ztree/ztree.css"></link>
  22. <!-- 树组件end -->
  23. <!-- 树形下拉框start -->
  24. <script type="text/javascript" src="<%=path%>/libs/js/form/selectTree.js"></script>
  25. <!-- 树形下拉框end -->
  26. <!-- 自动完成框start -->
  27. <script type="text/javascript" src="<%=path%>/libs/js/form/autoComplete.js"></script>
  28. <!-- 自动完成框end -->
  29. <!-- 日期选择框start -->
  30. <script type="text/javascript" src="<%=path%>/libs/js/form/datePicker/WdatePicker.js"></script>
  31. <!-- 日期选择框end -->
  32. <!-- 双向选择器start -->
  33. <script type="text/javascript" src="<%=path%>/libs/js/form/lister.js"></script>
  34. <!-- 双向选择器end -->
  35. <!-- 树形双选器start -->
  36. <script type="text/javascript" src="<%=path%>/libs/js/form/listerTree.js"></script>
  37. <!-- 树形双选器end -->
  38. <!-- 条件过滤器 start -->
  39. <script type="text/javascript" src="<%=path%>/libs/js/form/filter.js"></script>
  40. <!-- 条件过滤器 end -->
  41. <!-- 颜色选择器start -->
  42. <script type="text/javascript" src="<%=path%>/libs/js/form/color.js"></script>
  43. <!-- 颜色选择器start -->
  44. <!-- 数字步进器start -->
  45. <script type="text/javascript" src="<%=path%>/libs/js/form/stepper.js"></script>
  46. <!-- 数字步进器end -->
  47. <!-- 软键盘控件start -->
  48. <script type="text/javascript" src="<%=path%>/libs/js/form/keypad.js"></script>
  49. <!-- 软键盘控件start -->
  50. <!-- 评星级控件start -->
  51. <script type="text/javascript" src="<%=path%>/libs/js/form/rating.js"></script>
  52. <!-- 评星级控件end -->
  53. <!-- 异步上传控件start -->
  54. <script type="text/javascript" src="<%=path%>/libs/js/form/upload/fileUpload.js"></script>
  55. <script type="text/javascript" src="<%=path%>/libs/js/form/upload/handlers.js"></script>
  56. <!--异步上传控件end -->
  57. <!-- 表单验证start -->
  58. <script src="<%=path%>/libs/js/form/validationRule.js" type="text/javascript"></script>
  59. <script src="<%=path%>/libs/js/form/validation.js" type="text/javascript"></script>
  60. <!-- 表单验证end -->
  61. <!-- 表单异步提交start -->
  62. <script src="<%=path%>/libs/js/form/form.js" type="text/javascript"></script>
  63. <!-- 表单异步提交end -->
  64. </head>
  65. <body>
  66. <div class="box1" panelWidth="650">
  67. <div class="red">此示例由后台支持</div>
  68. <form id="myFormId" action="<%=path%>/updateWebformAjax.action" method="post" target="frmright">
  69. <table class="tableStyle" formMode="transparent">
  70. <input type="hidden" name="ajax" value="1"/>
  71. <input type="hidden" name="webForm.id" value="<s:property value="%{webForm.id}"/>" />
  72. <tr>
  73. <td width="100">文本框:</td>
  74. <td><input name="webForm.text" type="text" class="validate[required]" value="<s:property value="%{webForm.text}"/>"/><span class="star">*</span></td>
  75. <td width="100">自动完成框:</td>
  76. <td><input type="text" name="webForm.autoComplete" class="autoComplete" url="<%=path%>/form/getItemListByWord.action" value="<s:property value="%{webForm.autoComplete}"/>"/></td>
  77. </tr>
  78. <tr>
  79. <td>单选按钮:</td>
  80. <td>
  81. <s:radio list="#{'男':'男','女':'女'}" listKey="key" listValue="value"
  82. name="webForm.radio" value="%{webForm.radio}" template="customradiomap.ftl"></s:radio>
  83. </td>
  84. <td>多选按钮:</td>
  85. <td>
  86. <s:checkboxlist list="#{'唱歌':'唱歌','跳舞':'跳舞'}" listKey="key"
  87. listValue="value" name="webForm.checkbox"
  88. value="%{webForm.checkbox}" template="customcheckboxlist.ftl">
  89. </s:checkboxlist>
  90. </td>
  91. </tr>
  92. <tr>
  93. <td>单选下拉框:</td>
  94. <td>
  95. <select prompt="请选择" name="webForm.dropSelect" selectedValue="<s:property value="%{webForm.dropSelect}"/>" colNum="3" colWidth="80" class="validate[required]" mode="ajax" url="<%=path%>/form/getUserList.action"></select><span class="star">*</span>
  96. </td>
  97. <td>树形下拉框:</td>
  98. <td>
  99. <div class="selectTree" name="webForm.dropTree" selectedValue="<s:property value="%{webForm.dropTree}"/>" url="<%=path%>/getDepartmentsTree.action"></div>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td>多选下拉框:</td>
  104. <td>
  105. <div class="selectTree" name="webForm.mutiSelect" selectedValue="<s:property value="%{webForm.mutiSelect}"/>" url="<%=path%>/form/getDepartmentList.action" multiMode="true" noGroup="true"></div>
  106. </td>
  107. <td>树形多选框:</td>
  108. <td>
  109. <div class="selectTree" name="webForm.treeMutiSelect" selectedValue="<s:property value="%{webForm.treeMutiSelect}"/>" url="<%=path%>/getDepartmentsTree.action" multiMode="true"></div>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td>日期选择框:</td><td><input type="text" name="webForm.datePicker" class="date" value="<s:property value="%{webForm.datePicker}"/>"/></td>
  114. <td>颜色选择器:</td>
  115. <td>
  116. <input type="text" class="color" name="webForm.colorPicker" value="<s:property value="%{webForm.colorPicker}"/>"/>
  117. </td>
  118. </tr>
  119. <tr>
  120. <td>软键盘控件:</td>
  121. <td>
  122. <input type="text" name="webForm.keypad" class="keypad" value="<s:property value="%{webForm.keypad}"/>"/>
  123. </td>
  124. <td>数字步进器:</td>
  125. <td>
  126. <input type="text" class="stepper" name="webForm.stepper" value="<s:property value="%{webForm.stepper}"/>"/>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td>双向选择器:</td>
  131. <td colspan="3">
  132. <div class="lister" name="webForm.bothwaySelect" selectedValue="<s:property value="%{webForm.bothwaySelect}"/>" listerWidth="160" listerHeight="120" url="<%=path%>/form/getUsersOfDoubleSelect.action"></div>
  133. </td>
  134. </tr>
  135. <tr>
  136. <td>树形双选器:</td>
  137. <td colspan="3">
  138. <div class="listerTree" name="webForm.treeBothwaySelect" listerWidth="160" listerHeight="180" url="<%=path%>/form/getTreeLister.action" selectedValue="<s:property value="%{webForm.treeBothwaySelect}"/>"></div>
  139. </td>
  140. </tr>
  141. <tr>
  142. <td>条件过滤器:</td>
  143. <td colspan="3">
  144. <div class="filter" url="<%=path%>/form/getUserList.action" name="webForm.conditionFilter" selectedValue="<s:property value="%{webForm.conditionFilter}"/>"></div>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td>评星级控件:</td>
  149. <td colspan="3">
  150. <div class="rating" name="webForm.raty" value="<s:property value="%{webForm.raty}"/>"></div>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td>异步上传控件:</td>
  155. <td colspan="3">
  156. <input type="hidden" name="webForm.asynFile" id="hdn_file"/>
  157. <span id="uploadBtn"></span>
  158. <div id="uploadList"></div>
  159. <div id="uploadDeleteAll" style="display:none;"></div>
  160. </td>
  161. </tr>
  162. <tr>
  163. <td>文本域:</td>
  164. <td colspan="3">
  165. <textarea name="webForm.textarea"><s:property value="%{webForm.textarea}"/></textarea>
  166. </td>
  167. </tr>
  168. <tr>
  169. <td colspan="4">
  170. <input type="submit" value=" 提 交 "/>
  171. <input type="button" value=" 重 置 " onclick="formReset()"/>
  172. </td>
  173. </tr>
  174. </table>
  175. </form>
  176. </div>
  177. <script type="text/javascript">
  178. var upload;
  179. var catalogId = "<s:property value="%{webForm.asynFile}"/>";
  180. function initComplete(){
  181. //上传组件初始化
  182. $("#hdn_file").val(catalogId);
  183. upload = $.fileUpload.start({
  184. contextPath: "<%=path%>",
  185. buttonContainer: "uploadBtn",
  186. fileListContainer: "uploadList",
  187. deleteContainer: "uploadDeleteAll",
  188. moduleId : 'dcm',
  189. kind : 'template',
  190. catalogId: catalogId,
  191. uploadUrl:"/form/upLoadFile.action",
  192. deleteUrl:"/form/deleteFile?id=",
  193. deleteAllUrl:"/form/deleteByKind.action",
  194. listUrl:"/form/listByKind.action",
  195. fileNameWidth:240,
  196. editMode:true
  197. });
  198. //表单异步提交处理
  199. $('#myFormId').submit(function(){
  200. //判断表单的客户端验证时候通过
  201. var valid = $('#myFormId').validationEngine({returnIsValid: true});
  202. if(valid){
  203. $(this).ajaxSubmit({
  204. //表单提交成功后的回调
  205. success: function(responseText, statusText, xhr, $form){
  206. top.Dialog.alert("保存成功",function(){
  207. window.location.reload();
  208. });
  209. }
  210. });
  211. }
  212. //阻止表单默认提交事件
  213. return false;
  214. });
  215. $("input:submit").click(function(){
  216. var checkbox = "";
  217. $("input:checkbox:checked").each(function(){
  218. checkbox += $(this).attr("value") + ",";
  219. })
  220. $("input[name='webForm.checkbox']").attr("value",checkbox);
  221. })
  222. }
  223. //重置处理
  224. function formReset(){
  225. //重置表单元素
  226. $("#myFormId")[0].reset();
  227. //单独处理特殊组件的重置
  228. $("#myFormId select").resetValue();
  229. $("#myFormId .selectTree").resetValue();
  230. $("#myFormId .lister").resetValue();
  231. $("#myFormId .listerTree").resetValue();
  232. $("#myFormId .filter").resetValue();
  233. }
  234. </script>
  235. </body>
  236. </html>