struts2.0+E3.Table0.8分頁功能的實現

aiyikou發表於2008-11-04

 由於E3.Table0.8的分頁出來沒好久,所以還有些小功能暫未實現,以後在完善.

首先需要匯入以下幾個包

ajaxanywhere-1.2.1.jare3.jarvelocity-1.4.jardom4j-1.6.jar........等

 

package com.trendcom.webapp.action;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.googlecode.jsonplugin.annotations.JSON;
import com.trendcom.model.InfoFile;
import com.trendcom.model.InfoIssue;
import com.trendcom.service.FileManageService;
import com.trendcom.service.InfoFileService;
import com.trendcom.service.InfoIssueService;

@Controller
public class InfoIssueAction extends BaseAction {
	public InfoIssueAction(){};
	@Autowired
	InfoIssueService infoIssueService;

	List<InfoIssue> root;
	InfoIssue infoIssue;
	private int pageSize;


	public String showInfoIssue(){
		totalProperty=infoIssueService.getAllInfoIssue().size();   
		root=infoIssueService.getInfoIssue(start, 5);
		return "listSuccess";
	}
	
	
	public InfoIssue getInfoIssue() {
		return infoIssue;
	}
	public void setInfoIssue(InfoIssue infoIssue) {
		this.infoIssue = infoIssue;
	}

	public int getTotalProperty() {
		return totalProperty;
	}

	public Boolean getSuccess() {
		return success;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
         
         @JSON(name="root")
	public List<InfoIssue> getRoot() {
		return root;
	}

	public void setRoot(List<InfoIssue> root) {
		this.root = root;
	}

}

 

<%@ page language="java"  pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="e3t" uri="/e3/table/E3Table.tld" %>
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
</HEAD>
<body> 
<table><tr><td ><div id="x">
</div></td></tr></table>

<table><tr><td><div id="y">
</div></td></tr></table>

<c:url var="uri" value="${basePath}infoIssue/InfoIssue!show.action" />

<e3t:table id="userTable"
           var="info"
           varStatus="infoIssueStatus"
           items="infoIssue"
           caption="使用者管理"
           uri="${uri}"
           pageSize="2"
           skin="E3002"
           height="400"
           width="400"
          >  
    <e3t:column property="issueid"   title="使用者ID" width="120">
    </e3t:column>          
    <e3t:column property="caption" title="標題"  width="100"/>            
    <e3t:column property="maketop"      title="是否置頂"  width="60" />
    <e3t:column property="issued"      title="是否釋出" width="100" />
</e3t:table>
</body>
</HTML>

 

相關文章