a73c275e0b6098dcfa422dee0e348a0f7f9ac588.svn-base 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <%@ page import="net.sf.json.*"%>
  2. <%@ page pageEncoding="UTF-8"%>
  3. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  4. <%@ page import="java.util.*"%>
  5. <%@ page language="java"
  6. import="com.sysmodel.XFormFactory,
  7. com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
  8. com.sysmodel.collectmodel.xmlmodel.able.HiddenField"%>
  9. <%
  10. String begin=request.getParameter("start");
  11. String size=request.getParameter("limited");
  12. String callback=request.getParameter("callback");
  13. String pagid = request.getParameter("pagid") == null ? "" : request.getParameter("pagid");
  14. FormCollection FormCollection =(FormCollection)XFormFactory.getXFormModel().getFormCollection(pagid);
  15. ArrayList list = FormCollection.getAlHiddenFields();
  16. try{
  17. int index = Integer.parseInt(begin);
  18. int pageSize = Integer.parseInt(size);
  19. String json = callback+"({totalProperty:100,root:[";
  20. for (int i = 0; i < list.size(); i++) {
  21. HiddenField PramField = (HiddenField) list.get(i);
  22. String name = "<a href=\"edit.jsp?pagid="+pagid +"&name="+PramField.getName()+"\">"+PramField.getName()+"</a>";
  23. String value = PramField.getValue() == null ? "" :PramField.getValue();
  24. String valuemethod = PramField.getValueMethod() == null ? "" :PramField.getValueMethod();
  25. String del = "<a href=\"editExc.jsp?action=del&name=<"+PramField.getName() +"&pagid="+pagid +"\">删除</a>";
  26. Map map = new HashMap();
  27. map.put("name",name);
  28. map.put("value", value);
  29. map.put("valuemethod",valuemethod);
  30. map.put("del", del);
  31. JSONObject jsonMap = JSONObject.fromObject(map);
  32. System.out.println(jsonMap);
  33. json += jsonMap.toString();
  34. if (i != pageSize && list.size() > 1) {
  35. json += ",";
  36. }
  37. }
  38. json += "]});";
  39. System.out.println();
  40. System.out.println(json);
  41. System.out.println();
  42. response.getWriter().write(json);
  43. }catch(Exception e){
  44. }
  45. %>