Class LookupForm

java.lang.Object
org.kuali.rice.krad.web.form.UifFormBase
org.kuali.rice.krad.lookup.LookupForm
All Implemented Interfaces:
Serializable, ViewModel

public class LookupForm extends UifFormBase
Form class containing backing data for LookupView.
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • LookupForm

      public LookupForm()
  • Method Details

    • postBind

      public void postBind(javax.servlet.http.HttpServletRequest request)
      Picks out data object name from the request to retrieve a lookupable and for the initial get request populates the getFieldConversions() property. Called after Spring binds the request to the form and before the controller method is invoked
      Specified by:
      postBind in interface ViewModel
      Overrides:
      postBind in class UifFormBase
      Parameters:
      request - request object containing the query parameters
    • getLookupable

      public Lookupable getLookupable()
      Returns an Lookupable instance associated with the lookup view.
      Returns:
      Lookupable instance or null if one does not exist
    • getDataObjectClassName

      public String getDataObjectClassName()
      Class name for the data object the lookup should be performed against.

      The object class name is used to pick up a dictionary entry which will feed the attribute field definitions and other configuration. In addition it is to configure the Lookupable which will carry out the search action

      Returns:
      lookup data object class
    • setDataObjectClassName

      public void setDataObjectClassName(String dataObjectClassName)
      Parameters:
      dataObjectClassName - property value
    • isMultipleValuesSelect

      public boolean isMultipleValuesSelect()
      Indicates whether multiple values select should be enabled for the lookup.

      When set to true, the select field is enabled for the lookup results group that allows the user to select one or more rows for returning

      Returns:
      boolean true if multiple values should be enabled, false otherwise
    • setMultipleValuesSelect

      public void setMultipleValuesSelect(boolean multipleValuesSelect)
      See Also:
    • isRedirectedLookup

      public boolean isRedirectedLookup()
      Indicates whether the requested was redirected from the lookup framework due to an external object request.

      This prevents the framework from performing another redirect check

      Returns:
      boolean true if request was a redirect, false if not
    • setRedirectedLookup

      public void setRedirectedLookup(boolean redirectedLookup)
      See Also:
    • isReturnByScript

      public boolean isReturnByScript()
      Indicates whether the return value from the lookup should occur through script or a server side post (default is false, server side post).
      Returns:
      boolean true if return should occur though script, false if return should be done through server side post
    • setReturnByScript

      public void setReturnByScript(boolean returnByScript)
      See Also:
    • getReturnTarget

      public String getReturnTarget()
      Name of the window the lookup should return to.

      The lookup can be invoked from several different contexts: new tab, lightbox within top window, lightbox within portal window. When the request is made, this parameter can be sent to specify the target for the return links.

      Returns:
      String return target window name
    • setReturnTarget

      public void setReturnTarget(String returnTarget)
      org.kuali.rice.krad.lookup.LookupForm#getReturnTarget()
    • getLookupCollectionName

      public String getLookupCollectionName()
      For the case of multi-value lookup, indicates the collection that should be populated with the return results.
      Returns:
      String collection name (must be full binding path)
    • setLookupCollectionName

      public void setLookupCollectionName(String lookupCollectionName)
      See Also:
    • getLookupCollectionId

      public String getLookupCollectionId()
    • setLookupCollectionId

      public void setLookupCollectionId(String lookupCollectionId)
    • getReferencesToRefresh

      public String getReferencesToRefresh()
      String containing references that should be refreshed when the lookup returns, passed back on the return URL.
      Returns:
      String containing references that should be refreshed on return from lookup
    • setReferencesToRefresh

      public void setReferencesToRefresh(String referencesToRefresh)
      See Also:
    • getQuickfinderId

      public String getQuickfinderId()
      Id for the quickfinder that triggered the lookup action (if any).

      When the lookup is triggered from a quickfinder, the return URLs will be present on the lookup results. In addition, the quickfinder id is passed back on the return URL so the caller can perform logic based on which quickfinder was invoked.

      Returns:
      String id for quickfinder that invoked the lookup
    • setQuickfinderId

      public void setQuickfinderId(String quickfinderId)
      See Also:
    • getFieldConversions

      public Map<String,String> getFieldConversions()
      Map of conversions that should occur on the lookup return between properties on the lookup data object and properties on the calling view.

      When a lookup is invoked from a calling view, the purpose is to return one or more values that will populate fields on the calling view. To accomplish this, values for properties on the selected record are passed back on the URL as values for properties on the calling view. This map specifies which properties on the lookup data object should be pulled, and for each one what is the property on the caller to send the value back as.

      For example, suppose the map contained the entries id:document.bookId and title:document.bookTitle. When the return URL is selected for a record, the value for the id property will be retrieved and added to the return URL query string as 'document.bookId={idValue}'. Likewise the value for the title property will be pulled and added to the return URL query string as 'document.bookTitle={titleValue}'. So the query string will contain something like 'document.bookId=3invalid input: '&document'.bookTitle=Animals'

      Returns:
      Map of field conversions, each entry is a conversion between two properties. Key is property name on the lookup data object, entry value is the property name on the calling view/model
    • setFieldConversions

      public void setFieldConversions(Map<String,String> fieldConversions)
      See Also:
    • getMultiValueReturnFields

      public List<String> getMultiValueReturnFields()
      Holds the column names for the multi-value lookup selected values Note: as of KULRICE-12125 secure field names will not be stored in this parameter
      Returns:
      a list of column names for the multi-value lookup
    • setMultiValueReturnFields

      public void setMultiValueReturnFields(List<String> multiValueReturnFields)
      See Also:
    • getLookupCriteria

      public Map<String,String> getLookupCriteria()
      Map containing the criteria to be used for performing the search.

      Fields that are defined in the LookupView.getCriteriaGroup() bind to this map. The key of the map is the property path specified for the field, and the value of the map is the search value (if any) entered by the user. This map is then passed into the Lookupable to carry out the search.

      Returns:
      Map of search criteria where key is the property the criteria will be applied to and the value is the search value entered by the user (if any)
    • setLookupCriteria

      public void setLookupCriteria(Map<String,String> lookupCriteria)
      See Also:
    • getLookupResults

      public Collection<?> getLookupResults()
      Holds the results of a search action.

      After the search action is invoked, the results of the search will be held by this property. The LookupView.getResultsGroup() binds to this property for displaying the results.

      Returns:
      Collection of data objects that are the result of a search
    • setLookupResults

      public void setLookupResults(Collection<?> lookupResults)
      See Also:
    • isDisplayResults

      public boolean isDisplayResults()
    • setDisplayResults

      public void setDisplayResults(boolean displayResults)