@Override protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException { form.grdTemplates().getRows().clear(); if(form.txtName().getValue() == null) { engine.showErrors(new String[]{"Order Entry Template is mandatory"}); return; } OrderEntryTemplateLiteVoCollection voCollTemplates = domain.listActiveOrderEntryTemplatesByName(form.txtName().getValue()); if(voCollTemplates != null) { for(OrderEntryTemplateLiteVo voTemplate : voCollTemplates) { grdTemplatesRow row = form.grdTemplates().getRows().newRow(); row.setcolName(voTemplate.getFormName()); row.setValue(voTemplate); } if(voCollTemplates.size() == 0) engine.showMessage("No matching records found."); } }
/** * listActiveOrderEntryTemplatesByName */ public OrderEntryTemplateLiteVoCollection listActiveOrderEntryTemplatesByName(String name) { if (name == null || name.equals("")) throw new CodingRuntimeException("name is null or empty in method listActiveOrderEntryTemplatesByName"); name.replaceAll("%", ""); List templates = getDomainFactory().find("from OrderEntryTemplate oet where oet.activeStatus = :status and upper(oet.formName) like :name", new String[]{"status", "name"}, new Object[]{getDomLookup(PreActiveActiveInactiveStatus.ACTIVE),name.toUpperCase() + "%"}); return OrderEntryTemplateLiteVoAssembler.createOrderEntryTemplateLiteVoCollectionFromOrderEntryTemplate(templates); }