日期:2014-05-16  浏览次数:20708 次

extjs4.0 form数据加载问题。
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%String path=request.getContextPath();
   %>

<html>
<head>
<title>Test direct(Ext4)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css"
href="<%=path%>/ext-4.0.1/resources/css/ext-all.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/css/main.css">
<script type="text/javascript" src="<%=path%>/ext-4.0.1/ext-all.js"></script>
<script type="text/javascript" src="<%=path%>/paper/paperApi.js"></script>

<title>在线考试</title>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function(){
Ext.Direct.addProvider(Ext.paper.REMOTING_API);

var form=Ext.create('Ext.form.FormPanel', {
border:false,
fieldDefaults:{//统一设置表单字段默认属性
labelSeparator :':',//分隔符
labelWidth : 80,//标签宽度
width : 270,//字段宽度
msgTarget : 'under'
},
    
    api: {
        load: paper.load//加载数据的远程方法
      //提交数据的远程方法
    },
      //  disabled:true,
       items: [{
           xtype     : 'textfield',
           fieldLabel: '题号',
           name:'id'
          // disabled:true
         
       },{
        xtype     : 'textarea',
        fieldLabel: '题目',
        name:'context'
       // disabled:true
      
    },{
       xtype:'textfield',
       fieldLabel:'A',
       name:'answer1'
      /// disabled:true
        },{
            xtype:'textfield',
            fieldLabel:'B',
            name:'answer2'
        //    disabled:true
         },{
            xtype:'textfield',
            fieldLabel:'C',
            name:'answer3'
         //   disabled:true
            },{