private void restoreSearchCriteria() { OrderEntryTemplateListSearchCriteriaVo searchCriteria = form.getGlobalContext().OCRR.getOrderEntryTemplateListSearchCriteria(); if(searchCriteria == null) return; form.txtName().setValue(searchCriteria.getName()); form.cmbStatus().setValue(searchCriteria.getStatus()); form.cmbSite().setValue(searchCriteria.getLocation()); }
private void buildSearchCriteria() { OrderEntryTemplateListSearchCriteriaVo searchCriteria = new OrderEntryTemplateListSearchCriteriaVo(); searchCriteria.setName(form.txtName().getValue()); searchCriteria.setStatus(form.cmbStatus().getValue()); searchCriteria.setLocation(form.cmbSite().getValue()); form.getGlobalContext().OCRR.setOrderEntryTemplateListSearchCriteria(searchCriteria); }
private boolean isValidSearchCriteria() { OrderEntryTemplateListSearchCriteriaVo searchCriteria = form.getGlobalContext().OCRR.getOrderEntryTemplateListSearchCriteria(); if(searchCriteria == null) return false; if(searchCriteria.getNameIsNotNull() && searchCriteria.getName().trim().length() > 0) return true; if(searchCriteria.getLocationIsNotNull()) return true; if(searchCriteria.getStatusIsNotNull()) return true; return false; }
private void search() { form.grdDetails().getRows().clear(); OrderEntryTemplateListSearchCriteriaVo searchCriteria = form.getGlobalContext().OCRR.getOrderEntryTemplateListSearchCriteria(); if(searchCriteria == null) return; if(!isValidSearchCriteria()) { form.getGlobalContext().OCRR.setOrderEntryTemplateListSearchCriteria(null); engine.showMessage("Please Enter Some Search Criteria"); return; } OrderEntryTemplateShortVoCollection records = domain.listOrderEntryTemplates(searchCriteria); if(records != null) { records.sort(); for(int x = 0; x < records.size(); x++) { OrderEntryTemplateShortVo item = records.get(x); GenForm.grdDetailsRow row = form.grdDetails().getRows().newRow(form.getGlobalContext().OCRR.getSelectedOrderEntryTemplateIDIsNotNull() && form.getGlobalContext().OCRR.getSelectedOrderEntryTemplateID().equals(item.getID_OrderEntryTemplate())); row.setValue(item); row.setcolImage(form.getImages().OCRR.OrderEntryTemplate); row.setcolName(item.getFormName()); if(item.getActiveStatusIsNotNull()) row.setcolStatus(item.getActiveStatus().getText()); } if(form.grdDetails().getSelectedRowIndex() < 0) form.getGlobalContext().OCRR.setSelectedOrderEntryTemplateID(null); //--------------------------------------------- if(records.size() == 0) engine.showMessage("No Records Found!!!"); //---------------------------------------------- } setContextMenu(); }