📄 accountbalancebean.java
字号:
/*$Id: AccountBalanceBean.java,v 1.1 2008/07/15 03:36:41 liqi Exp $ *-------------------------------------- * Apusic (Kingdee Middleware) *--------------------------------------- * Copyright By Apusic ,All right Reserved * author date comment * wanx 2008-4-7 Created*/package org.operamasks.example.ejb.gl;import java.util.ArrayList;import java.util.Date;import java.util.List;import javax.annotation.PostConstruct;import javax.faces.model.SelectItem;import org.operamasks.example.ejb.gl.dao.OrmappingDaoBean;import org.operamasks.example.ejb.gl.entity.Person;import org.operamasks.faces.annotation.Bind;import org.operamasks.faces.annotation.ManagedBean;import org.operamasks.faces.annotation.ManagedBeanScope;import org.operamasks.faces.annotation.ManagedProperty;import org.operamasks.faces.annotation.SelectItems;import org.operamasks.faces.component.widget.page.PagedDataProvider;@ManagedBean(name = "accountBalanceBean", scope = ManagedBeanScope.SESSION)public class AccountBalanceBean extends ResourceBinding{ private static final int PAGE_SIZE = 10; @ManagedProperty("#{ormappingDaoBean}") private OrmappingDaoBean dao; @Bind(id="signPeople", attribute="value") @SelectItems(source="#{this.peopleItems}") public String signPeople; @Bind(id="signDate", attribute="value") public Date signDate; public int pageSize = PAGE_SIZE; // @Bind(id="accountBalanceGrid", attribute="binding")// public UIDataGrid accountBalanceGrid; @Bind(id="peopleInCharge", attribute="value") @SelectItems(source="#{this.peopleItems}") public String peopleInCharge; @Bind(id="fillFormPeople", attribute="value") @SelectItems(source="#{this.peopleItems}") public String fillFormPeople; @Bind(id="fillFormDate", attribute="value") public Date fillFormDate; public SelectItem[] getpeopleItems(){ List<SelectItem> result = new ArrayList<SelectItem>(); List<Person> persons = dao.getPersons(); for(Person person: persons){ result.add(new SelectItem(person.getId(), person.getName())); } return result.toArray(new SelectItem[0]); } @ManagedProperty private PagedDataProvider accountBalanceGridValues = new PagedDataProvider() { public Object getData(int start, int limit) { if(start < 0 || start > getTotalCount() -1 ) { throw new IllegalArgumentException("out of bound, start:" + start); } if( start + limit > getTotalCount()) { limit = getTotalCount() - start; } return dao.getAccountBalanceEnties(PAGE_SIZE, start); } public int getTotalCount() { return dao.getAccountBalanceEntiesCount(); } }; // public List<Object[]> getAccountBalanceGridValues(){// return dao.getAccountBalanceEnties();// }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -