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

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>



列表截图
...全文
222 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
课程介绍本套课程,大喵将带着大家手把手,编辑每一行代码,使用原生Javascipt及ES6的一些新特性,仿照目前国内非常流行的Vue框架的源码,开发构建一个属于你们自己的MVVM框架。让大家能够很清晰的学习及掌握,模板编译,数据绑定,响应式,文档碎片,观察者模式,发布订阅模式等等,这些Vue的核心知识点,都是怎么回事,它们之间有哪些关联,是如何进行双向数据绑定的等等。在使用vue2.x的核心Object.defineProperty构建完成框架后,大喵也会使用Vue3.0引入的数据劫持的Proxy新特性,来改造我们的MVVM框架,提升我们的框架性能。最终,大喵会手把手带着大家,从0开始配置webpack.config.js配置文件以及引入babel-loader,配置.babelrc文件,转换我们JS文件中的的ES6语法,最终压缩输出我们的MVVM框架库文件。课程目录01 手把手搭建MVVM框架 课程介绍、02 文件结构及基础类创建、03 入口类DamiaoMvvm的实现、04 模板编译、05 元素节点解析编译、06 v-model 数据绑定逻辑梳理、07 v-model 数据绑定实现、08 模板文本编译逻辑梳理、09 模板文本渲染绑定、10 观察者Wather逻辑梳理、11 Wather 逻辑实现、12 Object.defineProperty()、13 defineProperty 小案例、14 observer数据劫持梳理、15 defineProperty数据劫持实现、16 发布订阅类实现、17 Proxy 介绍与概述、18 使用Proxy改造MVVM框架、19 使用Proxy实现响应式、20 webpack 打包配置、21 babel 配置及文件输出、22 Mvvm Proxy 框架打包、23 Mvvm 框架搭建课程总结MVVM框架介绍MVVM是 Model-View-ViewModel 的缩。mvvm是一种设计思想。Model 层代表数据模型,也可以在Model中定义数据修改和操作的业务逻辑;View 代表UI 组件,它负责将数据模型转化成UI 展现出来,ViewModel 是一个同步View 和 Model的对象。在MVVM架构模式下,View 和 Model 之间并没有直接的联系,而是通过ViewModel进行交互,Model 和 ViewModel 之间的交互是双向的, 因此View 数据的变化会同步到Model中,而Model 数据的变化也会立即反应到View 上。ViewModel 通过双向数据绑定把 View 层和 Model 层连接了起来,而View 和 Model 之间的同步工作完全是自动的,无需人为干涉,因此开发者只需关注业务逻辑,不需要手动操作DOM, 不需要关注数据状态的同步问题,复杂的数据状态维护完全由 MVVM 来统一管理。

87,901

社区成员

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

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