textExc.jsp 4.1 KB

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