dwz cooperates with paging plug-in with conditional previous page and next page (to ensure that the data system remains unchanged)

 

// without form

listUi.jsp:

In general, there is a form, and the query conditions can be returned after the query. (The action of this form will be automatically called on the next page and the previous page)

In special cases: there is no form, the current page is originally the list detected by the previous conditions, so clicking the next one is because there is no form and no place to jump, 2, even if you own

A form is added, and the corresponding hidden field is used as a condition (empty form will find all values), since this page is jumped over (with parameter conditions), use model.addtribute(,) to add the condition,

It is easy to cause the effect of two identical hidden fields (a, a is normally a), at this time, you can use a different name to distinguish, which one is not empty in the background, take that one

<form method="post" rel="pagerForm" name="form1"

action="${pageContext.request.contextPath}/system/opmUser/listUi"

onsubmit="return navTabSearch(this)">

<div class="pageHeader">

<input type="hidden" name="organid1" value="${org}">

</div>

</form>

 

@RequestMapping(value="/system/opmUser/listUi")

public String listUi(@RequestParam(value="organid1", required=false) String organid1,OpmUserVo opmUser,HttpServletRequest request,Model modle) {

PageInfo<OpmUserVo> list= new PageInfo<>();

Map<String,Object> param = new HashMap<String,Object>();

param.put("pageNum", opmUser.getPageNum()+"");

param.put("pageSize", opmUser.getPageSize()+"");

OpmUser op = new OpmUser ();

if(organid1!=null&&!"".equals(organid1)){

op.setOrganid (organid1);

}else{

op.setOrganid(opmUser.getOrganid());

}

list = getUserListUI(param, op);

Subject currentUser = SecurityUtils.getSubject();

Session session = currentUser.getSession();

OpmUser user =(OpmUser) session.getAttribute("currentUser");

modle.addAttribute("list", list);

if(organid1!=null&&!"".equals(organid1)){

modle.addAttribute("org", organid1);

}else{

modle.addAttribute("org", opmUser.getOrganid());

}

 

modle.addAttribute("currnorg", user.getOrganid());

return "/system/opmUser/listUi";

 

}

Guess you like

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