The lookup screen provides the ability to search for business objects using criteria. Lookup screens also provides the ability to create new business object records, to edit or copy an existing record, and to drill down to obtain more information about a record. Naturally, the Client Framework Kuali Nervous System provides ways to customize the lookup screen as well - Lookup Helpers. Here, we'll discover the common ways Lookup screens are declared andhow we can use a custom lookup for one of our own business objects.
...
A lookup helper is simply a class that implements org.kuali.ricekfs.kns.lookup.LookupableHelperService
. LookupableHelperService
declares a large number of methods to define (~44), though. As we'll see, we don't have redefine all of those, and definitely, some are more used than others. Let's take a look at the most customized LookupableHelperService
methods.
...
Thankfully, we do have something to inherit from: two helper classes that we can extend, org.kuali.ricekfs.kns.lookup.AbstractLookupableHelperServiceImpl
and org.kuali.ricekfs.kns.lookup.KualiLookupableHelperServiceImpl
. We'll also take a look at LookupUtils
, which has handy static methods for looking up business objects.
...
KualiLookupableHelperServiceImpl extends AbstractLookupableHelperServiceImpl
to make a concrete class - that is, it implements getSearchResults() and reimplements a more functional version of getSearchResultsUnbounded(). It defers, ultimately, to the default implementation of org.kuali.ricekfs.kns.service.LookupService
, which does basic searching in the persistence store, using OJB queries.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<bean id="accountLookupableHelperService" class="org.kuali.kfs.coa.businessobject.lookup.KualiAccountLookupableHelperServiceImpl" scope="prototype" parent="lookupableHelperService" /> <bean id="accountLookupable" class="org.kuali.ricekfs.kns.lookup.KualiLookupableImpl" scope="prototype"> <property name="lookupableHelperService"> <ref bean="accountLookupableHelperService" /> </property> </bean> |
...