Dwz page embedded jump and operation completed jump refresh

The ref in a is the pronoun of the page he connects to (multiple names with the same name can be selected as a substitute value), and the page that jumps after the ref passed by the subsequent edit is completed is the background jump method of this ref page.

Note DWZ: callback of complex form, common The callback function of the form is different and
complex : iframeCallback(enctype="multipart/form-data")

<form method="post"
action="<c:url value='/basBed/update?navTabId=basBedNav&callbackType=closeCurrent'/> "
class="pageForm required-validate" enctype="multipart/form-data" onsubmit="return iframeCallback(this,navTabAjaxDone);">

Simple form:
<form method="post"
action="<c:url value= '/tbBasSpsxValue/update?navTabId=tbBasSpsxValueNav&callbackType=closeCurrent'/>"
class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone); ">
==================================
dwzIndex.jsp:
<li><a
href="${applicationScope.contextPath}/tbBasSpsxValue/list"
target="navTab" rel="tbBasSpsxValueNav" fresh="false">商品属性值</a></li>
<li>


list.jsp:
<div class="panelBar">
<ul class="toolBar">
<li><a class="add" target="navTab" rel="basBedNav"
href="<c:url value='/tbBasSpsxValue/edit'/>" title="商品属性项值"><span>添加</span></a></li>
<li><a class="edit" target="navTab" rel="basBedNav"
href="<c:url value='/tbBasSpsxValue/edit?spsxValueKey={slt_objId}'/>" title="商品属性项值"><span>编辑</span></a></li>
<li><a class="delete" target="ajaxTodo"
href="<c:url value='/tbBasSpsxValue/delete?spsxValueKey={slt_objId}'/>"
title="你确定要删除吗?"><span>删除</span></a></li>
<li class="line">line</li>
</ul>
</div>

edit.jsp:

=============================
The list here is covered (the last is edit), so edit cannot use basBedNav to select another one (defined in dwzIndex.jsp, then jump to the list, if basBedNav is used, it will jump to the last covered value to jump to edit)
<form method="post"
action="<c:url value='/tbBasSpsxValue/update?navTabId=tbBasSpsxValueNav&callbackType=closeCurrent'/>"
class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone );">


ajaxDone.jsp:
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
{
"statusCode":"${statusCode}",
"message": " 操作成功",
"navTabId":"${navTabId}",
"callbackType":"${callbackType}",
"forwardUrl":"${forwardUrl}"
}

java:


@RequestMapping(value = "/tbBasSpsxValue/update", method = RequestMethod.POST)
public ModelAndView insert(TbBasSpsxValue tbBasSpsxValue) throws IllegalStateException, IOException {
if(tbBasSpsxValue.getSpsxValueKey()!=null&&!"".equals(tbBasSpsxValue.getSpsxValueKey())){
int flag = tbBasSpsxValueService.updateTbBasSpsxValue(tbBasSpsxValue);
if(flag==1){
return ajaxDoneBasBed(200,"操作成功","");
         }else{

        return ajaxDoneBasBed(300,"操作失败","");
}
}else{
int flag= tbBasSpsxValueService.insertTbBasSpsxValue(tbBasSpsxValue);
if(flag==1){
return ajaxDoneBasBed(200,"操作成功","");
         }else{

        return ajaxDoneBasBed(300,"操作失败","/tbBasSpsxValue/list");
}
}

}

private ModelAndView ajaxDoneBasBed(int statusCode, String message, String forwardUrl) {
ModelAndView mav = new ModelAndView("/tbBasSpsxValue/ajaxDone");
mav.addObject("statusCode", statusCode);
mav.addObject("message", message);
mav.addObject("navTabId", "tbBasSpsxValueNav");
mav.addObject("callbackType", "closeCurrent");
mav.addObject("forwardUrl", "/tbBasSpsxValue/list");
return mav;
}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326572091&siteId=291194637