为什么我点修改按钮无法进入修改页面,修改按钮是前端框架的,这个页面和后台代码是我仿照其他页面写的

yuanwmeng 2017-11-21 06:14:57
这是列表页面

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/aofsoft.jsp"%>
<%@ include file="/common/easyui.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
$(function() {
$('#tt').datagrid({
autoRowHeight : true,
striped : true,
singleSelect : true,
fit : true,
hasHeight : 110
});
});
</script>
</head>

<body>
<form id="frmServices" action="sysreport!list.action" method="post">
<input type="hidden" id="page.pageNo" name="page.pageNo"
value="${page.pageNo}" /> <input type="hidden" id="page.pageSize"
name="page.pageSize" value="${page.pageSize}" />
<div class="panel-header">
<table width="100%" border="0" height="25">
<tr>
<td width="21">
<div class="icon-place" />
</td>
<td align="left"><aof:Place funmenuId="10308" /></td>
<td width="25" align="right">
<div class="icon-bizoper" />
</td>
<td align="left"><aof:OperHead /></td>
<td><aof:UoperRight funmenuId="10308" /></td>

</tr>
</table>
</div>
<!-- <table border="0" width="100%" class="query-info">
</table> -->
</form>
<table id="tt">
<thead>
<tr>
<th data-options="field:'ckid'" align="center" width="30"></th>
<th data-options="field:'tid'" align="center" width="30">序号</th>
<th data-options="field:'phoneNumber'" align="center" width="100">联系电话</th>
<th data-options="field:'copyrightPossessor1'" align="center" width="180">版权所有1</th>
<th data-options="field:'copyrightPossessor2'" align="left" width="180">版权所有2</th>
<th data-options="field:'userInfo.name'" align="center" width="80">修改用户</th>
<th data-options="field:'createTime'" align="center" width="150">修改时间</th>
</tr>
</thead>
<tbody>
<c:set value="0" var="i" scope="page" />
<s:iterator value="page.result">
<c:set value="${ pageScope.i + 1}" var="i" scope="page" />
<tr>
<td><input type="checkbox" name="objectId" value="${id}"
id="${id}" /></td>
<td><c:out
value="${(page.pageNo-1)* page.pageSize + pageScope.i }" /></td>
<td>${phoneNumber}</td>
<td>${copyrightPossessor1}</td>
<td>${copyrightPossessor2}</td>
<td>${userInfo.name}</td>
<td>${createTime}</td>

</tr>
</s:iterator>
</tbody>
</table>
<aof:page id="pp" fromId="frmServices" pageName="page" page="${page}" />
</body>
</html>
<script>
<script type="text/javascript">

var actionName = "copyrightinfo";
//提交保存
function submitFrm() {

return $('#frmServices').form('validate');
}

var state = document.frmServices.state.value;
if (state > 0) {
$('#high-search-btn').onclick = $("#high-search-box").slideToggle(500)
.siblings(".navContent").slideUp(500);
}

function addData() {
document.location.href = "copyrightinfo!input.action";
}

function getObjectIds(objectId) {
var result = "";
var objectId = document.getElementsByName(objectId);
var count = 0;
for (i = 0; i < objectId.length; i++) {
if (objectId[i].checked == true) {
result = result + objectId[i].value + ",";
count++;
}
}
//activeFun(count);
return result;
}

/* 通过ajax将当前所选择的id传到后台,然后判断是否有权限修改 */
function updateByAjax() {
var result = checkboxIds();
if (blankId(result) && oneId(result)) {
var array_id = result.split(",");
}
if (array_id[0] != 0) {
var id = array_id[0];
$
.ajax({
url : "${ctx}/vehicle/base/copyrightinfo!updateOperateByAjax.action",
type : "post",
data : {
id : id
},
dataType : "text",
success : function(data) {
var text = eval("(" + data + ")");
if (text == "true") {
updateData(id);
} else {
alert("对不起,只能管理员有权限删除!");
}
}
});
}
};

}
// 修改操作
function updateData() {
var pageNum = "${page.pageNo}";
var result = checkboxIds();
if (blankId(result) && oneId(result)) {
var array_id = result.split(",");
document.location.href = "copyrightinfo!update.action?id=" + id
+ "&page.pageNo=" + pageNum;
return true;
}
return false;

}

</script>




这是修改jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/aofsoft.jsp"%>
<%@ include file="/common/easyui.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form name="frmServices" id="frmServices"
action="copyrightinfo!save.action" method="post">
<input type="hidden" name="id" id="id" value="${entity.id}" /><input
type="hidden" name="page.PageNo" value="${page.pageNo}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="42"><img src="${ctx}/images/bt01.jpg" width="42"
height="33" /></td>
<td align="left" class="bt01"><c:choose>
<c:when test="${empty entity.id}">添加</c:when>
<c:otherwise>修改</c:otherwise>
</c:choose>版权信息</td>
<td width="7" align="right"><img src="${ctx}/images/bt03.jpg"
width="7" height="33" /></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="1" bgcolor="#6C92AD">
<tr height="25">
<td width="13%" align="center" class="bt02">联系电话</td>
<td width="37%" align="left" class="bt03"><input type="text"
id="phoneNumber" name="phoneNumber" size="30"
value="${entity.phoneNumber}" class="easyui-validatebox"
data-options="required:true,validType:'length[3,50]'" />  <font
color="red">*</font></td>
</tr>
<tr height="25">
<td width="13%" align="center" class="bt02">版权所有1</td>
<td width="37%" align="left" class="bt03"><input type="text"
id="copyrightPossessor1" name="copyrightPossessor1" size="30"
value="${entity.copyrightPossessor1}" class="easyui-validatebox"
data-options="required:true,validType:'length[3,50]'" />  <font
color="red">*</font></td>
</tr>
<tr height="25">
<td width="13%" align="center" class="bt02">版权所有2</td>
<td width="37%" align="left" class="bt03"><input type="text"
id="copyrightPossessor2" name="copyrightPossessor2" size="30"
value="${entity.copyrightPossessor2}" class="easyui-validatebox"
data-options="required:true,validType:'length[1,3]'" />  <font
color="red">*</font></td>
</tr>

</table>
<table width="100%" align="center" border="0"
style="margin-top: 10px;">
<tr>
<td align="center">
<div id="dlg-buttons">
<a href="javascript:vsubmit('#frmServices');"
class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a>
<a href="javascript:vback();" class="easyui-linkbutton"
data-options="iconCls:'icon-back'">返回</a>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
<script type="text/javascript">
function vsubmit(frmId) {
if ($(frmId).form('validate')) {
$.messager.defaults = {
ok : "确定",
cancel : "取消"
};
$.messager.confirm('保存确认', '您确认要保存数据吗?', function(r) {
if (r)
$(frmId).submit();
});
}
}
function vback() {
window.history.back();
}

function vsubmit(frmId) {
if ($(frmId).form('validate')) {
$.messager.defaults = {
ok : "确定",
cancel : "取消"
};
$.messager.confirm('保存确认', '您确认要保存数据吗?', function(r) {
if (r)
$(frmId).submit();
});
}
}

//判断是否数字类型
$("input[checktype=isNUM]").each(function(i,em){
if($(this).attr("checktype")=="isNUM"){
if(!isNUM($(this).val())){
ischeck= false;
alert("请输入正确的数字!");
$(this).focus();
return false;
}
}

});


if(ischeck){
return $('#frmServices').form('validate');
}else{
return false;
}

}

function isHZ(strString){
//验证是否是汉字输入,为空不是汉字,不为空返回汉字串
s=strString
s=s.replace(/[^\u4E00-\u9FA5]/g,"")
return s
}

function isNUM(str){
//验证是否0-9范围的数字
var re = /^[0-999999]+$/ ;
return re.test(str)
}








$(function(){
window.onload=function(){
//检查方式赋值
var checkeds = $("#hiddenjcfs").val();
var checkArray =checkeds.split(",");
var checkBoxAll = $("input[name='jcfs']");

for(var i = 0; i < checkBoxAll.length; i++){
for(var j = 0; j < checkArray.length; j++){
var value = ltrim(checkArray[j]);
if(checkBoxAll[i].value==value){
checkBoxAll[i].checked = true;
break;
}
}
}
//检查项赋值
checkeds = $("#hiddenjcx").val();
checkArray =checkeds.split(",");
checkBoxAll = $("input[name='jcx']");

for(var i = 0; i < checkBoxAll.length; i++){
for(var j = 0; j < checkArray.length; j++){
var value = ltrim(checkArray[j]);
if(checkBoxAll[i].value==value){
checkBoxAll[i].checked = true;
break;
}
}
}

function ltrim(str){ //删除左边的空格
  return str.replace(/(^\s*)/g,"");
}
}
});


$(function(){
$('select.myselect').selectOrDie();
$("#date_a,#date_b").datepicker({
dateFormat: 'yy-mm-dd',
showOn: "button",
buttonImage: "${ctx}/GUI2/datepicker/images/calendar.gif",
buttonImageOnly: true
});
$('#high-search-btn').click(function(){
$("#high-search-box").slideToggle(500).siblings(".navContent").slideUp(500);
})
});
</script>



列表截图
...全文
224 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

87,921

社区成员

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

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