@Override protected void onQmbCategoryTextSubmited(String value) throws PresentationLogicException { String cat = value; form.ctnFindReport().qmbCategory().clear(); if(!cat.startsWith("%")) cat = "%" + cat; if(!cat.endsWith("%")) cat = cat + "%"; ReportsCategoryLiteVoCollection coll = domain.searchCategoryByName(cat); if(coll != null && coll.size() > 0) { for(ReportsCategoryLiteVo item : coll) { form.ctnFindReport().qmbCategory().newRow(item, item.getName()); } if(coll.size() == 1) form.ctnFindReport().qmbCategory().setValue(coll.get(0)); else form.ctnFindReport().qmbCategory().showOpened(); } }
@Override protected void onQmbCategoryTextSubmited(String value) throws PresentationLogicException { String cat = value; form.ctnFindReport().qmbCategory().clear(); if(cat.length() > 48) cat = cat.substring(0, 48); if(!cat.startsWith("%")) cat = "%" + cat; if(!cat.endsWith("%")) cat = cat + "%"; ReportsCategoryLiteVoCollection coll = domain.searchCategoryByName(cat); if(coll != null && coll.size() > 0) { for(ReportsCategoryLiteVo item : coll) { form.ctnFindReport().qmbCategory().newRow(item, item.getName()); } if(coll.size() == 1) form.ctnFindReport().qmbCategory().setValue(coll.get(0)); else form.ctnFindReport().qmbCategory().showOpened(); } }
@SuppressWarnings({"unchecked", "rawtypes"}) public ReportsCategoryLiteVoCollection searchCategoryByName(String categoryName) { StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append("from ReportsCategory as cat "); cond.append(andStr + "UPPER(cat.name) like UPPER(:categoryName)"); markers.add("categoryName"); values.add(categoryName); andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); hql.append(" order by cat.name"); DomainFactory factory = getDomainFactory(); List list = factory.find(hql.toString(), markers, values); return ReportsCategoryLiteVoAssembler.createReportsCategoryLiteVoCollectionFromReportsCategory(list); }
@Override protected void onQmbCategoryTextSubmited(String value) throws PresentationLogicException { String cat = value; form.qmbCategory().clear(); if(cat.length() > 48) cat = cat.substring(0, 48); if(!cat.startsWith("%")) cat = "%" + cat; if(!cat.endsWith("%")) cat = cat + "%"; ReportsCategoryLiteVoCollection coll = domain.searchCategoryByName(cat); if(coll != null && coll.size() > 0) { for(ReportsCategoryLiteVo item : coll) { form.qmbCategory().newRow(item, item.getName()); } if(coll.size() == 1) form.qmbCategory().setValue(coll.get(0)); else form.qmbCategory().showOpened(); } }
@SuppressWarnings("unchecked") public ReportsCategoryLiteVoCollection searchCategoryByName(String categoryName) { StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append("from ReportsCategory as cat "); cond.append(andStr + "upper(cat.name) like :categoryName"); //wdev-14251 markers.add("categoryName"); values.add(categoryName.toUpperCase()); //wdev-14251 andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); hql.append(" order by cat.name"); DomainFactory factory = getDomainFactory(); List list = factory.find(hql.toString(), markers, values); return ReportsCategoryLiteVoAssembler.createReportsCategoryLiteVoCollectionFromReportsCategory(list); }
public ReportsCategoryLiteVoCollection searchCategoryByName(String categoryName) { ReportRunner impl = (ReportRunner)getDomainImpl(ReportRunnerImpl.class); return impl.searchCategoryByName(categoryName); }