1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.select.lookup;
17
18 import org.kuali.ole.sys.OLEConstants;
19 import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
20 import org.kuali.rice.kns.web.struts.form.LookupForm;
21 import org.kuali.rice.kns.web.ui.Field;
22 import org.kuali.rice.kns.web.ui.Row;
23 import org.kuali.rice.krad.bo.BusinessObject;
24 import java.util.Iterator;
25 import java.util.List;
26 import java.util.Map;
27
28 public class OleLoadSumRecordLookupableHelperServiceImpl extends KualiLookupableHelperServiceImpl {
29
30 @Override
31 public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues) {
32 String fileName = fieldValues.get("fileName");
33 if (!fileName.contains("*")) {
34 StringBuilder loadFileName = new StringBuilder();
35 loadFileName.append("*");
36 loadFileName.append(fileName);
37 loadFileName.append("*");
38 fieldValues.put("fileName", loadFileName.toString());
39 }
40 return super.getSearchResults(fieldValues);
41 }
42
43 @Override
44 public void performClear(LookupForm lookupForm){
45 super.performClear(lookupForm);
46 for (Iterator iter = this.getRows().iterator(); iter.hasNext();) {
47 Row row = (Row) iter.next();
48 for (Iterator iterator = row.getFields().iterator(); iterator.hasNext();) {
49 Field field = (Field) iterator.next();
50 if(field.getPropertyName().equalsIgnoreCase(OLEConstants.PRINCIPAL_ID)){
51 field.setPropertyValue(null);
52 }
53 }
54 }
55 }
56
57 }