日期:2014-05-16 浏览次数:20445 次
function operate(record){
myForm.getForm().loadRecord(record)
myWindow.show();
};
function operate(personId){
myForm.getForm().load({
url: myPerson.findById(personId)
});
myWindow.show();
};
public void findById(Long id, HttpServletResponse response) {
Person person = personDAO.findById(id);
List list = new ArrayList();
list.add(person);
JSONObject job = new JSONObject();
job.put("success", true);
job.put("person", list);
try {
System.out.println(job.toString());
response.getWriter().print(job.toString());
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("ok1");
e.printStackTrace();
}
}
var myForm = new Ext.form.FormPanel({
width: 300,
bodyStyle: 'padding:5px 5px 0',
frame: true,
reader: new Ext.data.JsonReader({
successProperty: 'success',
root: 'person'
},['personId','personName','sex','age','hobby']),
items: [
{
fieldLabel:'PERSONID',
xtype:'textfield',
readOnly:true,
name:'personId',
id:'personId',
readOnly: true
}。。。。。。。