View Javadoc
1   package org.kuali.ole.select.lookup;
2   
3   import org.kuali.rice.kns.lookup.KualiLookupableImpl;
4   import org.kuali.rice.kns.web.struts.form.LookupForm;
5   import org.kuali.rice.kns.web.ui.Field;
6   import org.kuali.rice.kns.web.ui.Row;
7   
8   import java.util.Iterator;
9   
10  /**
11   * Created with IntelliJ IDEA.
12   * User: vivekb
13   * Date: 2/26/14
14   * Time: 7:54 PM
15   * To change this template use File | Settings | File Templates.
16   */
17  public class OLEPurchaseOrderItemLookupableImpl  extends KualiLookupableImpl{
18  
19      /**
20       * calls the lookup helper service to do "clear" behaviors
21       *
22       */
23      @Override
24      public void performClear(LookupForm lookupForm) {
25          for (Iterator iter = this.getRows().iterator(); iter.hasNext();) {
26              Row row = (Row) iter.next();
27              for (Iterator iterator = row.getFields().iterator(); iterator.hasNext();) {
28                  Field field = (Field) iterator.next();
29                  if (!field.getPropertyName().equalsIgnoreCase("vendorHeaderGeneratedIdentifier") &&
30                          !field.getPropertyName().equalsIgnoreCase("vendorDetailAssignedIdentifier")) {
31                      if (field.isSecure()) {
32                          field.setSecure(false);
33                          field.setDisplayMaskValue(null);
34                          field.setEncryptedValue(null);
35                      }
36  
37                      if (!field.getFieldType().equals(Field.RADIO)) {
38                          field.setPropertyValue(field.getDefaultValue());
39                          if (field.getFieldType().equals(Field.MULTISELECT)) {
40                              field.setPropertyValues(null);
41                          }
42                      }
43                  }
44              }
45          }
46      }
47  }