dateExc.jsp 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  2. <%@ page language="java"
  3. import="java.util.*,
  4. com.sysmodel.listmodel.xmlmodel.impl.FormListImpl,
  5. com.sysmodel.xformmodel.importcontrol.DateControl,
  6. com.sysmodel.listmodel.xmlmodel.impl.QueryFieldImpl,
  7. com.sysmodel.xformmodel.impl.ValidateImpl,
  8. com.sysmodel.listmodel.xmlmanager.xmlobjdll.ListModeldllImpl
  9. "%>
  10. <%
  11. String listid = request.getParameter("listid") == null ? "" : request.getParameter("listid");
  12. String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid");
  13. String dataName = request.getParameter("dataName") == null ? "" : request.getParameter("dataName");
  14. String label = request.getParameter("label") == null ? "" : request.getParameter("label");
  15. String operator = request.getParameter("operator") == null ? "" : request.getParameter("operator");
  16. String size = request.getParameter("size") == null ? "" : request.getParameter("size");
  17. String format = request.getParameter("format") == null ? "" : request.getParameter("format");
  18. String action = request.getParameter("action") == null ? "" : request.getParameter("action");
  19. String regxValue = request.getParameter("regxValue") == null ? "" : request.getParameter("regxValue");
  20. String dojoInuptType = request.getParameter("dojoInuptType") == null ? "" : request.getParameter("dojoInuptType");
  21. String invalidMessage = request.getParameter("invalidMessage") == null ? "" : request.getParameter("invalidMessage");
  22. String promptMessage = request.getParameter("promptMessage") == null ? "" : request.getParameter("promptMessage");
  23. System.out.println("listid="+listid);
  24. System.out.println("classid="+classid);
  25. System.out.println("dataName="+dataName);
  26. System.out.println("label="+label);
  27. System.out.println("operator="+operator);
  28. System.out.println("size="+size);
  29. System.out.println("format="+format);
  30. System.out.println("action="+action);
  31. FormListImpl FormList = null;
  32. if(session.getAttribute("FormList"+listid) == null){
  33. return;
  34. } else {
  35. FormList = (FormListImpl)session.getAttribute("FormList"+listid);
  36. QueryFieldImpl queryField = new QueryFieldImpl();
  37. queryField.setClassid(Integer.parseInt(classid));
  38. queryField.setDataName(dataName);
  39. queryField.setLabel(label);
  40. queryField.setOperator(operator);
  41. queryField.setControlType("date");
  42. DateControl DateControl = new DateControl();
  43. DateControl.setSize(size);
  44. DateControl.setFormat(format);
  45. queryField.setControl(DateControl);
  46. ValidateImpl Validate = new ValidateImpl();
  47. Validate.setRegxValue(regxValue);
  48. Validate.setDojoType(dojoInuptType);
  49. Validate.setPromptMessage(promptMessage);
  50. Validate.setInvalidMessage(invalidMessage);
  51. queryField.setValidate(Validate);
  52. if(action.equals("add")){
  53. ArrayList QueryFields=FormList.getQueryFields();
  54. QueryFields.add(queryField);
  55. FormList.setQueryFields(QueryFields);
  56. }else if(action.equals("edit")){
  57. String oDataName = request.getParameter("oDataName") == null ? "" : request.getParameter("oDataName");
  58. String oLabel = request.getParameter("oLabel") == null ? "" : request.getParameter("oLabel");
  59. ListModeldllImpl ListModeldllImpl=new ListModeldllImpl();
  60. ListModeldllImpl.updateQueryField(FormList,queryField,oDataName,oLabel);
  61. }
  62. session.setAttribute("FormList"+listid,FormList);
  63. %>
  64. <% }%>
  65. <script type="text/javascript">
  66. var url = window.opener.location.href;
  67. url = url.replace("sessionReload=true","sessionReload=false");
  68. window.opener.location.replace(url);
  69. window.close();
  70. </script>