📄 companysearchlistaction.java
字号:
package com.leeman.wkexs.master.company.web;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import com.leeman.wkexs.web.base.BaseConstants;
import com.leeman.common.web.ui.CachedPager;
import com.leeman.wkexs.master.company.entity.*;
import com.leeman.wkexs.master.company.handler.*;
import com.leeman.wkexs.web.base.BaseCollectionCache;
import com.leeman.wkexs.web.base.BaseSearchListAction;
public class CompanySearchListAction extends BaseSearchListAction{
public void initSearchListForm(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{
CompanySearchForm searchForm = (CompanySearchForm) form;
ArrayList activeList = this.getSysXlatItemListByFieldWithBlank(BaseConstants.XLAT_ACTIVE_TYPE, getLangId(request));
searchForm.setActiveList(activeList);
}
/**
* Overrides
*/
public void doNewSearch(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
setInitFocus(request, "document.forms[0].company_id");
}
public void doSearch(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
CompanySearchForm searchForm = (CompanySearchForm)form;
//Do the Searching
BaseCollectionCache collectionCache = (BaseCollectionCache)getCollectionCache(request);
CompanySO searchKey = getSearchFormData((CompanySearchForm)form, request);
CachedPager pager = collectionCache.getSearchListPager();
CompanyHandler handler = CompanyHandlerHelper.getCompanyHandler();
ArrayList result = handler.getList(searchKey, pager.calcCacheRecordStart(), pager.getCacheRecordSize());
handler.remove();
pager.setCachedRange(pager.calcCacheRecordStart(), result.size());
collectionCache.setSearchListResults(result);
}
protected CompanySO getSearchFormData(CompanySearchForm form, HttpServletRequest request) throws Exception{
CompanySO so = new CompanySO();
so.setCompany_id(form.getCompany_id().trim());
so.setCompany_name(form.getCompany_name().trim());
so.setCompany_address(form.getCompany_address().trim());
so.setBase_currency(form.getBase_currency().trim());
so.setTelephone(form.getTelephone().trim());
so.setFax(form.getFax().trim());
so.setEmail(form.getEmail().trim());
so.setActive(form.getActive().trim());
return so;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -