package test;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import javax.faces.model.SelectItem;
import org.ajax4jsf.component.html.HtmlAjaxRepeat;
import org.richfaces.component.UIDataTable;
public class Bean {
private String caption;
private Vector<Person> people = new Vector<Person>();
private UIDataTable table;
//private Integer curRow = new Integer(-2);
private int curRow = -2;
private Vector<String> reps = new Vector<String>();
HtmlAjaxRepeat repeat;
private List<SelectItem> leftPickList = new ArrayList<SelectItem>();
private List<Person> pickListResult = new ArrayList<Person>();
private boolean firstFill = true;
private SelectItemConverter converter;
public Bean(){
caption = "person list";
add();
reps.add("00001");
reps.add("00002");
reps.add("00003");
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption;
}
public Vector<Person> getPeople() {
return people;
}
public void setPeople(Vector<Person> people) {
this.people = people;
}
public UIDataTable getTable() {
return table;
}
public void setTable(UIDataTable table) {
this.table = table;
}
public int getCurRow() {
return curRow;
}
public void setCurRow(int curRow) {
this.curRow = curRow;
}
public Vector<String> getReps() {
return reps;
}
public HtmlAjaxRepeat getRepeat() {
return repeat;
}
public void setRepeat(HtmlAjaxRepeat repeat) {
this.repeat = repeat;
}
public void save(){
for(Iterator<Person> ite = people.iterator();ite.hasNext();){
Person p = ite.next();
System.out.println("============="+p.getName()+" has "+p.getAge());
}
}
public void del(){
System.out.println("cur row is "+curRow);
/*
if((curRow.intValue()) >= 0){
people.removeElementAt((curRow.intValue()));
}
*/
if((curRow) >= 0){
people.removeElementAt((curRow));
}
}
public void add(){
people.add(new Person("abc","m",20,"qinghe"));
people.add(new Person("def","f",30,"yunnan"));
people.add(new Person("ghi","m",25,"tangshan"));
}
public List<SelectItem> getLeftPickList() {
List<Person> tmpList = new ArrayList<Person>();
tmpList.add(new Person("abc","m",20,"qinghe"));
tmpList.add(new Person("def","f",30,"yunnan"));
tmpList.add(new Person("ghi","m",25,"tangshan"));
if(firstFill){
//adding result items to the list to be added to the converter
// for(RoleVO x: this.pickListResult)
// tmpList.add(x);
//getAvailableSelectionListFromDatabase
converter = new SelectItemConverter(tmpList);
}
firstFill = false;
//adding all items to the SelectItem-list
for(Person b: tmpList){
SelectItem s = new SelectItem(b,b.getName());
this.leftPickList.add(s);
}
return leftPickList;
}
public void setLeftPickList(List<SelectItem> leftPickList) {
this.leftPickList = leftPickList;
}
public List<Person> getPickListResult() {
return pickListResult;
}
public void setPickListResult(List<Person> pickListResult) {
this.pickListResult = pickListResult;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
testTable.rar (45个子文件)
testTable
.project 1KB
.settings
org.eclipse.core.resources.prefs 88B
.mymetadata 300B
WebRoot
WEB-INF
fmt-1_0.tld 12KB
fmt.tld 19KB
sql-1_0-rt.tld 5KB
fmt-1_0-rt.tld 11KB
permittedTaglibs.tld 1KB
web.xml 1KB
scriptfree.tld 2KB
c-1_0-rt.tld 11KB
c-1_0.tld 11KB
faces-config.xml 618B
x-1_0-rt.tld 7KB
x.tld 12KB
sql.tld 8KB
lib
myfaces-impl-1.2.4.jar 742KB
richfaces-api-3.2.2.GA.jar 165KB
commons-collections-3.2.jar 558KB
jstl.jar 20KB
myfaces-api-1.2.4.jar 365KB
commons-digester-1.8.jar 140KB
commons-discovery-0.4.jar 75KB
commons-beanutils-1.7.0.jar 184KB
jsf-api.jar 300KB
commons-codec-1.3.jar 46KB
jsf-impl.jar 1.08MB
richfaces-ui-3.2.2.GA.jar 2.41MB
richfaces-impl-3.2.2.GA.jar 1.43MB
commons-logging-1.1.1.jar 59KB
standard.jar 384KB
classes
test
Bean.class 3KB
Person.class 1KB
sql-1_0.tld 6KB
c.tld 16KB
fn.tld 7KB
x-1_0.tld 7KB
index.jsp 98B
META-INF
MANIFEST.MF 39B
pages
testDataTable.jsp 3KB
testRepeat.jsp 3KB
.myeclipse
src
test
SelectItemConverter.java 1KB
Person.java 802B
Bean.java 3KB
.classpath 3KB
共 45 条
- 1
jackhoo
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0