652cc565d192afa1cf45f46e6f4f2d41e7566be3.svn-base 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  2. <%@ page language="java"
  3. import="com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
  4. com.sysmodel.collectmodel.xmlmodel.impl.ReportFieldImpl,
  5. com.sysmodel.xformmodel.importcontrol.DateControl,
  6. com.sysmodel.xformmodel.impl.ValidateImpl,
  7. com.sysmodel.collectmodel.xmlmodel.impl.PageBodyImpl,
  8. com.sysmodel.collectmodel.xmlmanager.xmlobjdll.CollectModeldllImpl"%>
  9. <%
  10. String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
  11. String label = request.getParameter("label") == null ? "" : request.getParameter("label");
  12. String name = request.getParameter("name") == null ? "" : request.getParameter("name");
  13. String colspan = request.getParameter("colspan") == null ? "" : request.getParameter("colspan");
  14. String size = request.getParameter("size") == null ? "" : request.getParameter("size");
  15. String need = request.getParameter("need") == null ? "false" : request.getParameter("need");
  16. String trime = request.getParameter("trime") == null ? "false" : request.getParameter("trime");
  17. String format = request.getParameter("format") == null ? "" : request.getParameter("format");
  18. String action = request.getParameter("action") == null ? "" : request.getParameter("action");
  19. String oName = request.getParameter("oName") == null ? "" : request.getParameter("oName");
  20. String regxValue = request.getParameter("regxValue") == null ? "" : request.getParameter("regxValue");
  21. String invalidMessage = request.getParameter("invalidMessage") == null ? "" : request.getParameter("invalidMessage");
  22. String promptMessage = request.getParameter("promptMessage") == null ? "" : request.getParameter("promptMessage");
  23. String dojoInuptType = request.getParameter("dojoInuptType") == null ? "" : request.getParameter("dojoInuptType");
  24. FormCollection FormCollection = null;
  25. if(session.getAttribute("FormCollect"+pageid) == null ){
  26. return;
  27. } else {
  28. FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
  29. ReportFieldImpl ReportFieldImpl = new ReportFieldImpl();
  30. ReportFieldImpl.setLabel(label) ;
  31. ReportFieldImpl.setName(name);
  32. ReportFieldImpl.setControlType("date");
  33. if(!colspan.equals("")){
  34. ReportFieldImpl.setColspan(colspan);
  35. }
  36. DateControl DateControl = new DateControl();
  37. DateControl.setFormat(format);
  38. DateControl.setSize(size);
  39. ReportFieldImpl.setControl(DateControl);
  40. ValidateImpl Validate = new ValidateImpl();
  41. Validate.setNeed(new Boolean(need).booleanValue());
  42. Validate.setTrim(new Boolean(trime).booleanValue());
  43. Validate.setRegxValue(regxValue);
  44. Validate.setPromptMessage(promptMessage);
  45. Validate.setInvalidMessage(invalidMessage);
  46. Validate.setDojoType(dojoInuptType);
  47. ReportFieldImpl.setValidate(Validate);
  48. CollectModeldllImpl CollectModeldllImpl = new CollectModeldllImpl();
  49. if(action.equals("add")){
  50. PageBodyImpl PageBodyImpl = (PageBodyImpl)FormCollection.getPageBody();
  51. PageBodyImpl.addReportField(ReportFieldImpl);
  52. }else if(action.equals("edit")){
  53. CollectModeldllImpl.updateReportField(FormCollection , ReportFieldImpl , oName);
  54. }
  55. session.setAttribute("FormCollect"+pageid , FormCollection);
  56. %>
  57. <script type="text/javascript">
  58. var url = window.opener.location.href;
  59. url = url.replace("sessionReload=true","sessionReload=false");
  60. window.opener.location.replace(url);
  61. window.close();
  62. </script>
  63. <%} %>