radioExc.jsp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.datamodel.xmlmodel.ModelFactory,
  5. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
  6. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  7. com.sysmodel.datamodel.xmlmodel.able.MdpAttribute,
  8. com.sysmodel.collectmodel.xmlmodel.impl.ReportFieldImpl,
  9. com.sysmodel.xformmodel.importcontrol.RadioControl,
  10. com.sysmodel.xformmodel.impl.ValidateImpl,
  11. com.sysmodel.collectmodel.xmlmodel.impl.PageBodyImpl,
  12. com.sysmodel.collectmodel.xmlmanager.xmlobjdll.CollectModeldllImpl"%>
  13. <%
  14. String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
  15. String label = request.getParameter("label") == null ? "" : request.getParameter("label");
  16. String name = request.getParameter("name") == null ? "" : request.getParameter("name");
  17. String colspan = request.getParameter("colspan") == null ? "" : request.getParameter("colspan");
  18. String need = request.getParameter("need") == null ? "false" : request.getParameter("need");
  19. String action = request.getParameter("action") == null ? "" : request.getParameter("action");
  20. String oName = request.getParameter("oName") == null ? "" : request.getParameter("oName");
  21. String singleLine = request.getParameter("singleLine") == null ? "false" : request.getParameter("singleLine");
  22. String dojoInuptType = request.getParameter("dojoInuptType") == null ? "" : request.getParameter("dojoInuptType");
  23. SysModel sysmodel = ModelFactory.getSysmodel();
  24. MdpClassImpl MdpClass = null;
  25. FormCollection FormCollection = null;
  26. if(session.getAttribute("FormCollect"+pageid) == null ){
  27. return;
  28. } else {
  29. FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
  30. ReportFieldImpl ReportFieldImpl = new ReportFieldImpl();
  31. int iclassid = Integer.parseInt(FormCollection.getClassid());
  32. MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
  33. ReportFieldImpl.setLabel(label) ;
  34. ReportFieldImpl.setName(name);
  35. ReportFieldImpl.setControlType("radio");
  36. if(!colspan.equals("")){
  37. ReportFieldImpl.setColspan(colspan);
  38. }
  39. RadioControl RadioControl = new RadioControl();
  40. MdpAttribute MdpAttribute = MdpClass.getMdpAttributeByName(name);
  41. RadioControl.setConstantName(MdpAttribute.getReference().getReferenceTable());
  42. RadioControl.setSingleLine(new Boolean(singleLine).booleanValue());
  43. ReportFieldImpl.setControl(RadioControl);
  44. ValidateImpl ValidateImpl = new ValidateImpl();
  45. ValidateImpl.setNeed(new Boolean(need).booleanValue());
  46. ValidateImpl.setDojoType(dojoInuptType);
  47. ReportFieldImpl.setValidate(ValidateImpl);
  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. <%} %>