Chris Barham 先生在 http://code.google.com/p/pagingappfuse/ 给出了 AppFuse 中 DisplayTag 组件外部排序和分页的过程,他使用了
spring mvc ,我需要转换为 struts2,但我是 AppFuse 新手,许多地方不明白,请教各位。Chris Barham需要转换的代码如下:
<display:table name="authorityList" class="table" requestURI="" id="authorityList" export="true" pagesize="25">public class AuthorityController implements Controller {
...
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
ExtendedPaginatedList paginatedList = paginateListFactory
.getPaginatedListFromRequest(request);
manager.getAllRecordsPage(Authority.class, paginatedList);
return new ModelAndView().addObject("authorityList", paginatedList);
}
...
}我要转换成:
<display:table name="customers" class="table" requestURI="" id="MycustomerListId" export="true"
pagesize="5" style="width:1000px;white-space:nowrap;">public class CustomerAction extends BaseAction implements Preparable {
...
public String list() {
ExtendedPaginatedList paginatedList = paginateListFactory.getPaginatedListFromRequest(getRequest());
pagingManager.getAllRecordsPage(Customer.class, paginatedList);
getRequest().setAttribute("MycustomerListId", paginatedList); //这是最主要的改变
return SUCCESS;
}
...
}
在 eclipse 中调试时发现 paginatedList 已经有正确的数据集合了,但是找不到 MycustomerListId ,显示的页面是空表,没有数据。
请教,如何才能设置正确的返回结果集?
spring mvc ,我需要转换为 struts2,但我是 AppFuse 新手,许多地方不明白,请教各位。Chris Barham需要转换的代码如下:
<display:table name="authorityList" class="table" requestURI="" id="authorityList" export="true" pagesize="25">public class AuthorityController implements Controller {
...
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
ExtendedPaginatedList paginatedList = paginateListFactory
.getPaginatedListFromRequest(request);
manager.getAllRecordsPage(Authority.class, paginatedList);
return new ModelAndView().addObject("authorityList", paginatedList);
}
...
}我要转换成:
<display:table name="customers" class="table" requestURI="" id="MycustomerListId" export="true"
pagesize="5" style="width:1000px;white-space:nowrap;">public class CustomerAction extends BaseAction implements Preparable {
...
public String list() {
ExtendedPaginatedList paginatedList = paginateListFactory.getPaginatedListFromRequest(getRequest());
pagingManager.getAllRecordsPage(Customer.class, paginatedList);
getRequest().setAttribute("MycustomerListId", paginatedList); //这是最主要的改变
return SUCCESS;
}
...
}
在 eclipse 中调试时发现 paginatedList 已经有正确的数据集合了,但是找不到 MycustomerListId ,显示的页面是空表,没有数据。
请教,如何才能设置正确的返回结果集?
把你的代码改成
<display:table name="MycustomerListId" class="table" requestURI="" id="MycustomerListId" export="true"
pagesize="5" style="width:1000px;white-space:nowrap;">
就好了
谢谢你,确实好了,难道display:table只认name吗?
另外,不采用外部分页时,浏览到每一行时,鼠标是手形,可以点击进行该行的详细页面。
现在鼠标变成了指针 ,点击无效,不能进入详细页面了。