关于ExtJS 提交表单到StrutsAction的问题

micro_sun_ibm 2010-06-30 09:41:39
我现在用ExtJs写了文本框 然后点发布 将内容提交到 action页面 然后存入DB
现在出现一个问题
我现在输入内容点提交后 action中是可以接收到值
但是状态栏报了个JS的错误
提示说是
n为空或不是对象
找了半天也没找到错误的地方 大家帮我看下 到底是哪引发的错误

贴代码:


<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<link rel="stylesheet" type="text/css"
href="../resources/css/ext-all.css" />
<script type="text/javascript" src="../adapter/ext/ext-base.js"></script>

<script type="text/javascript" src="../ext-all.js"></script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>
<script type="text/javascript">
Ext.onReady(function() {
var formPanel = new Ext.form.FormPanel({
baseCls: 'x-plain',
layout:'absolute',
url:'save-form.php',
defaultType: 'textfield',

items: [{
xtype: 'textarea',
name: 'content',
anchor: '100% 100%' // anchor width and height,
}]
});


var window = new Ext.Window({
title: 'Resize Me',
width: 400,
height:150,
minWidth: 400,
minHeight: 150,
maxWidth: 400,
maxHeight: 150,
closeAction:"close",
closable:false,
collapsible:true,
layout: 'fit',
plain:true,
bodyStyle:'padding:2px;',
buttonAlign:'right',
items: formPanel,

buttons:[{
text:"发布",
type:"submit",
handler:function(){
if(formPanel.form.isValid()){
var f = function(v) {
return function(){
var i = v / 11;
Ext.MessageBox.updateProgress(i, '');
}
}
for(var i = 1; i < 13; i++) {
setTimeout(f(i), i * 150);
}
//提交到服务器操作
formPanel.form.doAction("submit",{
url:"content.action",
method:"post",
params:"",
success:function(formPanel, action){
document.location='comment.jsp';
},
failure:function(form, action){
}
});
}
}
}]
});

window.show();
});
</script>

</body>
</html>
...全文
118 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
micro_sun_ibm 2010-07-06
  • 打赏
  • 举报
回复
没人知道怎么回事么?

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧