1 /**
2 * Copyright 2005-2012 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.krad.uif.widget;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.bo.DataObjectRelationship;
20 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
21 import org.kuali.rice.krad.uif.UifParameters;
22 import org.kuali.rice.krad.uif.container.CollectionGroup;
23 import org.kuali.rice.krad.uif.element.Action;
24 import org.kuali.rice.krad.uif.field.InputField;
25 import org.kuali.rice.krad.uif.view.View;
26 import org.kuali.rice.krad.uif.component.BindingInfo;
27 import org.kuali.rice.krad.uif.component.Component;
28 import org.kuali.rice.krad.uif.util.ViewModelUtils;
29 import org.kuali.rice.krad.util.KRADUtils;
30
31 import java.util.HashMap;
32 import java.util.List;
33 import java.util.Map;
34
35 /**
36 * Widget for navigating to a lookup from a field (called a quickfinder)
37 *
38 * @author Kuali Rice Team (rice.collab@kuali.org)
39 */
40 public class QuickFinder extends WidgetBase {
41 private static final long serialVersionUID = 3302390972815386785L;
42
43 // lookup configuration
44 private String baseLookupUrl;
45 private String dataObjectClassName;
46 private String viewName;
47
48 private String referencesToRefresh;
49
50 private Map<String, String> fieldConversions;
51 private Map<String, String> lookupParameters;
52
53 // lookup view options
54 private String readOnlySearchFields;
55
56 private Boolean hideReturnLink;
57 private Boolean suppressActions;
58 private Boolean autoSearch;
59 private Boolean lookupCriteriaEnabled;
60 private Boolean supplementalActionsEnabled;
61 private Boolean disableSearchButtons;
62 private Boolean headerBarEnabled;
63 private Boolean showMaintenanceLinks;
64
65 private Boolean multipleValuesSelect;
66 private String lookupCollectionName;
67
68 private Action quickfinderAction;
69 private LightBox lightBoxLookup;
70
71 public QuickFinder() {
72 super();
73
74 fieldConversions = new HashMap<String, String>();
75 lookupParameters = new HashMap<String, String>();
76 }
77
78 /**
79 * The following initialization is performed:
80 *
81 * <ul>
82 * <li>Set defaults for binding</li>
83 * </ul>
84 *
85 * @see org.kuali.rice.krad.uif.component.ComponentBase#performInitialization(org.kuali.rice.krad.uif.view.View,
86 * java.lang.Object)
87 */
88 @Override
89 public void performInitialization(View view, Object model) {
90 super.performInitialization(view, model);
91
92 if (quickfinderAction != null) {
93 quickfinderAction.setActionScript("voidAction");
94 }
95 }
96
97 /**
98 * The following finalization is performed:
99 *
100 * <ul>
101 * <li>
102 * Sets defaults on collectionLookup such as collectionName, and the class if not set
103 *
104 * <p>
105 * If the data object class was not configured for the lookup, the class configured for the collection group will
106 * be used if it has a lookup defined. If not data object class is found for the lookup it will be disabled. The
107 * collection name is also defaulted to the binding path for this collection group, so the results returned from
108 * the lookup will populate this collection. Finally field conversions will be generated based on the PK fields of
109 * the collection object class
110 * </p>
111 * </li>
112 * </ul>
113 *
114 * @see org.kuali.rice.krad.uif.widget.Widget#performFinalize(org.kuali.rice.krad.uif.view.View,
115 * java.lang.Object, org.kuali.rice.krad.uif.component.Component)
116 */
117 @Override
118 public void performFinalize(View view, Object model, Component parent) {
119 super.performFinalize(view, model, parent);
120
121 if (!isRender()) {
122 return;
123 }
124
125 if (parent instanceof InputField) {
126 InputField field = (InputField) parent;
127
128 // determine lookup class, field conversions and lookup parameters in
129 // not set
130 if (StringUtils.isBlank(dataObjectClassName)) {
131 DataObjectRelationship relationship = getRelationshipForField(view, model, field);
132
133 // if no relationship found cannot have a quickfinder
134 if (relationship == null) {
135 setRender(false);
136 return;
137 }
138
139 dataObjectClassName = relationship.getRelatedClass().getName();
140
141 if ((fieldConversions == null) || fieldConversions.isEmpty()) {
142 generateFieldConversions(field, relationship);
143 }
144
145 if ((lookupParameters == null) || lookupParameters.isEmpty()) {
146 generateLookupParameters(field, relationship);
147 }
148 }
149
150 // adjust paths based on associated attribute field
151 updateFieldConversions(field.getBindingInfo());
152 updateLookupParameters(field.getBindingInfo());
153 } else if (parent instanceof CollectionGroup) {
154 CollectionGroup collectionGroup = (CollectionGroup) parent;
155
156 // check to see if data object class is configured for lookup, if so we will assume it should be enabled
157 // if not and the class configured for the collection group is lookupable, use that
158 if (StringUtils.isBlank(getDataObjectClassName())) {
159 Class<?> collectionObjectClass = collectionGroup.getCollectionObjectClass();
160 boolean isCollectionClassLookupable = KRADServiceLocatorWeb.getViewDictionaryService().isLookupable(
161 collectionObjectClass);
162 if (isCollectionClassLookupable) {
163 setDataObjectClassName(collectionObjectClass.getName());
164
165 if ((fieldConversions == null) || fieldConversions.isEmpty()) {
166 // use PK fields for collection class
167 List<String> collectionObjectPKFields =
168 KRADServiceLocatorWeb.getDataObjectMetaDataService().listPrimaryKeyFieldNames(
169 collectionObjectClass);
170
171 for (String pkField : collectionObjectPKFields) {
172 fieldConversions.put(pkField, pkField);
173 }
174 }
175 } else {
176 // no available data object class to lookup so need to disable quickfinder
177 setRender(false);
178 }
179 }
180
181 // set the lookup return collection name to this collection path
182 if (isRender() && StringUtils.isBlank(getLookupCollectionName())) {
183 setLookupCollectionName(collectionGroup.getBindingInfo().getBindingPath());
184 }
185 }
186
187 quickfinderAction.addActionParameter(UifParameters.BASE_LOOKUP_URL, baseLookupUrl);
188 quickfinderAction.addActionParameter(UifParameters.DATA_OBJECT_CLASS_NAME, dataObjectClassName);
189
190 if (!fieldConversions.isEmpty()) {
191 quickfinderAction.addActionParameter(UifParameters.CONVERSION_FIELDS, KRADUtils.buildMapParameterString(
192 fieldConversions));
193 }
194
195 if (!lookupParameters.isEmpty()) {
196 quickfinderAction.addActionParameter(UifParameters.LOOKUP_PARAMETERS, KRADUtils.buildMapParameterString(
197 lookupParameters));
198 }
199
200 addActionParameterIfNotNull(UifParameters.VIEW_NAME, viewName);
201 addActionParameterIfNotNull(UifParameters.READ_ONLY_FIELDS, readOnlySearchFields);
202 addActionParameterIfNotNull(UifParameters.HIDE_RETURN_LINK, hideReturnLink);
203 addActionParameterIfNotNull(UifParameters.SUPRESS_ACTIONS, suppressActions);
204 addActionParameterIfNotNull(UifParameters.REFERENCES_TO_REFRESH, referencesToRefresh);
205 addActionParameterIfNotNull(UifParameters.AUTO_SEARCH, autoSearch);
206 addActionParameterIfNotNull(UifParameters.LOOKUP_CRITERIA_ENABLED, lookupCriteriaEnabled);
207 addActionParameterIfNotNull(UifParameters.SUPPLEMENTAL_ACTIONS_ENABLED, supplementalActionsEnabled);
208 addActionParameterIfNotNull(UifParameters.DISABLE_SEARCH_BUTTONS, disableSearchButtons);
209 addActionParameterIfNotNull(UifParameters.HEADER_BAR_ENABLED, headerBarEnabled);
210 addActionParameterIfNotNull(UifParameters.SHOW_MAINTENANCE_LINKS, showMaintenanceLinks);
211 addActionParameterIfNotNull(UifParameters.MULTIPLE_VALUES_SELECT, multipleValuesSelect);
212 addActionParameterIfNotNull(UifParameters.LOOKUP_COLLECTION_NAME, lookupCollectionName);
213
214 // TODO:
215 // org.kuali.rice.kns.util.FieldUtils.populateQuickfinderDefaultsForLookup(Class,
216 // String, Field)
217 }
218
219 protected void addActionParameterIfNotNull(String parameterName, Object parameterValue) {
220 if ((parameterValue != null) && StringUtils.isNotBlank(parameterValue.toString())) {
221 quickfinderAction.addActionParameter(parameterName, parameterValue.toString());
222 }
223 }
224
225 protected DataObjectRelationship getRelationshipForField(View view, Object model, InputField field) {
226 String propertyName = field.getBindingInfo().getBindingName();
227
228 // get object instance and class for parent
229 Object parentObject = ViewModelUtils.getParentObjectForMetadata(view, model, field);
230 Class<?> parentObjectClass = null;
231 if (parentObject != null) {
232 parentObjectClass = parentObject.getClass();
233 }
234
235 // get relationship from metadata service
236 return KRADServiceLocatorWeb.getDataObjectMetaDataService().getDataObjectRelationship(parentObject,
237 parentObjectClass, propertyName, "", true, true, false);
238 }
239
240 protected void generateFieldConversions(InputField field, DataObjectRelationship relationship) {
241 fieldConversions = new HashMap<String, String>();
242 for (Map.Entry<String, String> entry : relationship.getParentToChildReferences().entrySet()) {
243 String fromField = entry.getValue();
244 String toField = entry.getKey();
245
246 // TODO: displayedFieldnames in
247 // org.kuali.rice.kns.lookup.LookupUtils.generateFieldConversions(BusinessObject,
248 // String, DataObjectRelationship, String, List, String)
249
250 fieldConversions.put(fromField, toField);
251 }
252 }
253
254 protected void generateLookupParameters(InputField field, DataObjectRelationship relationship) {
255 lookupParameters = new HashMap<String, String>();
256 for (Map.Entry<String, String> entry : relationship.getParentToChildReferences().entrySet()) {
257 String fromField = entry.getKey();
258 String toField = entry.getValue();
259
260 // TODO: displayedFieldnames and displayedQFFieldNames in
261 // generateLookupParameters(BusinessObject,
262 // String, DataObjectRelationship, String, List, String)
263
264 if (relationship.getUserVisibleIdentifierKey() == null || relationship.getUserVisibleIdentifierKey().equals(
265 fromField)) {
266 lookupParameters.put(fromField, toField);
267 }
268 }
269 }
270
271 /**
272 * Adjusts the path on the field conversion to property to match the binding
273 * path prefix of the given <code>BindingInfo</code>
274 *
275 * @param bindingInfo - binding info instance to copy binding path prefix from
276 */
277 public void updateFieldConversions(BindingInfo bindingInfo) {
278 Map<String, String> adjustedFieldConversions = new HashMap<String, String>();
279 for (String fromField : fieldConversions.keySet()) {
280 String toField = fieldConversions.get(fromField);
281 String adjustedToFieldPath = bindingInfo.getPropertyAdjustedBindingPath(toField);
282
283 adjustedFieldConversions.put(fromField, adjustedToFieldPath);
284 }
285
286 this.fieldConversions = adjustedFieldConversions;
287 }
288
289 /**
290 * Adjusts the path on the lookup parameter from property to match the binding
291 * path prefix of the given <code>BindingInfo</code>
292 *
293 * @param bindingInfo - binding info instance to copy binding path prefix from
294 */
295 public void updateLookupParameters(BindingInfo bindingInfo) {
296 Map<String, String> adjustedLookupParameters = new HashMap<String, String>();
297 for (String fromField : lookupParameters.keySet()) {
298 String toField = lookupParameters.get(fromField);
299 String adjustedFromFieldPath = bindingInfo.getPropertyAdjustedBindingPath(fromField);
300
301 adjustedLookupParameters.put(adjustedFromFieldPath, toField);
302 }
303
304 this.lookupParameters = adjustedLookupParameters;
305 }
306
307 /**
308 * @see org.kuali.rice.krad.uif.component.ComponentBase#getComponentsForLifecycle()
309 */
310 @Override
311 public List<Component> getComponentsForLifecycle() {
312 List<Component> components = super.getComponentsForLifecycle();
313
314 components.add(quickfinderAction);
315 components.add(lightBoxLookup);
316
317 return components;
318 }
319
320 /**
321 * Returns the URL for the lookup for which parameters will be added
322 *
323 * <p>
324 * The base URL includes the domain, context, and controller mapping for the lookup invocation. Parameters are
325 * then added based on configuration to complete the URL. This is generally defaulted to the application URL and
326 * internal KRAD servlet mapping, but can be changed to invoke another application such as the Rice standalone
327 * server
328 * </p>
329 *
330 * @return String lookup base URL
331 */
332 public String getBaseLookupUrl() {
333 return this.baseLookupUrl;
334 }
335
336 /**
337 * Setter for the lookup base url (domain, context, and controller)
338 *
339 * @param baseLookupUrl
340 */
341 public void setBaseLookupUrl(String baseLookupUrl) {
342 this.baseLookupUrl = baseLookupUrl;
343 }
344
345 /**
346 * Full class name the lookup should be provided for
347 *
348 * <p>
349 * This is passed on to the lookup request for the data object the lookup should be rendered for. This is then
350 * used by the lookup framework to select the lookup view (if more than one lookup view exists for the same
351 * data object class name, the {@link #getViewName()} property should be specified to select the view to render).
352 * </p>
353 *
354 * @return String lookup class name
355 */
356 public String getDataObjectClassName() {
357 return this.dataObjectClassName;
358 }
359
360 /**
361 * Setter for the class name that lookup should be provided for
362 *
363 * @param dataObjectClassName
364 */
365 public void setDataObjectClassName(String dataObjectClassName) {
366 this.dataObjectClassName = dataObjectClassName;
367 }
368
369 /**
370 * When multiple target lookup views exists for the same data object class, the view name can be set to
371 * determine which one to use
372 *
373 * <p>
374 * When creating multiple lookup views for the same data object class, the view name can be specified for the
375 * different versions (for example 'simple' and 'advanced'). When multiple lookup views exist the view name must
376 * be sent with the data object class for the request. Note the view id can be alternatively used to uniquely
377 * identify the lookup view
378 * </p>
379 */
380 public String getViewName() {
381 return this.viewName;
382 }
383
384 /**
385 * Setter for the view name configured on the lookup view that should be invoked by the quickfinder widget
386 *
387 * @param viewName
388 */
389 public void setViewName(String viewName) {
390 this.viewName = viewName;
391 }
392
393 /**
394 * List of property names on the model that should be refreshed when the lookup returns
395 *
396 * <p>
397 * Note this is only relevant when the return by script option is not enabled (meaning the server will be invoked
398 * on the lookup return call)
399 * </p>
400 *
401 * <p>
402 * When a lookup return call is made (to return a result value) the controller refresh method will be invoked. If
403 * refresh properties are configured, a call to refresh those references from the database will be made. This is
404 * useful if the lookup returns a foreign key field and the related record is needed.
405 * </p>
406 *
407 * @return String list of property names to refresh
408 * TODO: refactor this to be a List type
409 */
410 public String getReferencesToRefresh() {
411 return this.referencesToRefresh;
412 }
413
414 /**
415 * Setter for the list of property names that should be refreshed when the lookup returns
416 *
417 * @param referencesToRefresh
418 */
419 public void setReferencesToRefresh(String referencesToRefresh) {
420 this.referencesToRefresh = referencesToRefresh;
421 }
422
423 /**
424 * Map that determines what properties from a result lookup row (if selected) will be returned to properties on
425 * the calling view
426 *
427 * <p>
428 * The purpose of using the lookup is to search for a particular value and return that value to the form being
429 * completed. In order for the lookup framework to return the field back to us, we must specify the name of the
430 * field on the data object class whose value we need, and the name of the field on the calling view. Furthermore,
431 * we can choose to have the lookup return additional fields that populate other form fields or informational
432 * properties (see ‘Field Queries and Informational Properties’). These pairs of fields are known as
433 * ‘field conversions’.
434 * </p>
435 *
436 * <p>
437 * The fieldConversions property is a Map. Each entry represents a field that will be returned back from the
438 * lookup, with the entry key being the field name on the data object class, and the entry value being the field
439 * name on the calling view. It is helpful to think of this as a from-to mapping. Pulling from the data object
440 * field (map key) to the calling view field (map value).
441 * </p>
442 *
443 * @return Map<String, String> mapping of lookup data object property names to view property names
444 */
445 public Map<String, String> getFieldConversions() {
446 return this.fieldConversions;
447 }
448
449 /**
450 * Setter for the map that determines what properties on a lookup result row are returned and how they map to
451 * properties on the calling view
452 *
453 * @param fieldConversions
454 */
455 public void setFieldConversions(Map<String, String> fieldConversions) {
456 this.fieldConversions = fieldConversions;
457 }
458
459 /**
460 * Map that determines what properties from a calling view will be sent to properties on that are rendered
461 * for the lookup view's search fields (they can be hidden)
462 *
463 * <p>
464 * When invoking a lookup view, we can pre-populate search fields on the lookup view with data from the view
465 * that called the lookup. The user can then perform the search with these values, or (if edited is allowed or
466 * the fields are not hidden) change the passed in values. When the lookup is invoked, the values for the
467 * properties configured within the lookup parameters Map will be pulled and passed along as values for the
468 * lookup view properties
469 * </p>
470 *
471 * @return Map<String, String> mapping of calling view properties to lookup view search fields
472 */
473 public Map<String, String> getLookupParameters() {
474 return this.lookupParameters;
475 }
476
477 /**
478 * Setter for the map that determines what property values on the calling view will be sent to properties on the
479 * lookup views search fields
480 *
481 * @param lookupParameters
482 */
483 public void setLookupParameters(Map<String, String> lookupParameters) {
484 this.lookupParameters = lookupParameters;
485 }
486
487 /**
488 * Comma delimited String of property names on the lookup view that should be read only
489 *
490 * <p>
491 * When requesting a lookup view, property names for fields that are rendered as search criteria can be marked
492 * as read-only. This is usually done when a lookup parameter for that property is sent in and the user should
493 * not be allowed to change the value
494 * </p>
495 *
496 * @return String property names (delimited by a comma) whose criteria fields should be read-only on the
497 * lookup view
498 */
499 public String getReadOnlySearchFields() {
500 return this.readOnlySearchFields;
501 }
502
503 /**
504 * Setter for property names for criteria fields on the lookup view that should be read-only (multiple property
505 * names are specified using a comma delimiter)
506 *
507 * @param readOnlySearchFields
508 */
509 public void setReadOnlySearchFields(String readOnlySearchFields) {
510 this.readOnlySearchFields = readOnlySearchFields;
511 }
512
513 /**
514 * Indicates whether the return links for lookup results should be rendered
515 *
516 * <p>
517 * A lookup view can be invoked to allow the user to select a value (or set of values) to return back to the
518 * calling view. For single value lookups this is done with a return link that is rendered for each row. This
519 * return link can be disabled by setting this property to true
520 * </p>
521 *
522 * @return boolean true if the return link should not be shown, false if it should be
523 */
524 public Boolean getHideReturnLink() {
525 return this.hideReturnLink;
526 }
527
528 /**
529 * Setter for the hide return link indicator
530 *
531 * @param hideReturnLink
532 */
533 public void setHideReturnLink(Boolean hideReturnLink) {
534 this.hideReturnLink = hideReturnLink;
535 }
536
537 /**
538 * Indicates whether the maintenance actions (or others) are rendered on the invoked lookup view
539 *
540 * <p>
541 * By default a lookup view will add an actions column for the result table that display maintenance links (in
542 * addition to a new link at the top of the page) if a maintenance action is available. Custom links can also be
543 * added to the action column as necessary. This flag can be set to true to suppress the rendering of the actions
544 * for the lookup call.
545 * </p>
546 *
547 * <p>
548 * An example of when this might be useful is when invoking a lookup to return a value to a value. Generally in
549 * these cases you don't want to the user going off to another view (such as the maintenance view)
550 * </p>
551 *
552 * @return boolean true if actions should be rendered, false if not
553 */
554 public Boolean getSuppressActions() {
555 return suppressActions;
556 }
557
558 /**
559 * Setter for the suppress actions indicator
560 *
561 * @param suppressActions
562 */
563 public void setSuppressActions(Boolean suppressActions) {
564 this.suppressActions = suppressActions;
565 }
566
567 /**
568 * Indicates whether the search should be executed when first rendering the lookup view
569 *
570 * <p>
571 * By default the lookup view is rendered, the user enters search values and executes the results. This flag can
572 * be set to true to indicate the search should be performed before showing the screen to the user. This is
573 * generally used when search criteria is being passed in as well
574 * </p>
575 *
576 * @return boolean true if the search should be performed initially, false if not
577 */
578 public Boolean getAutoSearch() {
579 return this.autoSearch;
580 }
581
582 /**
583 * Setter for the auto search indicator
584 *
585 * @param autoSearch
586 */
587 public void setAutoSearch(Boolean autoSearch) {
588 this.autoSearch = autoSearch;
589 }
590
591 /**
592 * Indicates whether the lookup criteria (search group) should be enabled on the invoked lookup view
593 *
594 * <p>
595 * Setting the this to false will not display the lookup criteria but only the results. Therefore this is only
596 * useful when setting {@link #getAutoSearch()} to true and passing in criteria
597 * </p>
598 *
599 * @return true if lookup criteria should be displayed, false if not
600 */
601 public Boolean getLookupCriteriaEnabled() {
602 return this.lookupCriteriaEnabled;
603 }
604
605 /**
606 * Setter for enabling the lookup criteria group
607 *
608 * @param lookupCriteriaEnabled
609 */
610 public void setLookupCriteriaEnabled(Boolean lookupCriteriaEnabled) {
611 this.lookupCriteriaEnabled = lookupCriteriaEnabled;
612 }
613
614 /**
615 * TODO: not implemented currently
616 *
617 * @return
618 */
619 public Boolean getSupplementalActionsEnabled() {
620 return this.supplementalActionsEnabled;
621 }
622
623 public void setSupplementalActionsEnabled(Boolean supplementalActionsEnabled) {
624 this.supplementalActionsEnabled = supplementalActionsEnabled;
625 }
626
627 /**
628 * TODO: not implemented currently
629 *
630 * @return
631 */
632 public Boolean getDisableSearchButtons() {
633 return this.disableSearchButtons;
634 }
635
636 public void setDisableSearchButtons(Boolean disableSearchButtons) {
637 this.disableSearchButtons = disableSearchButtons;
638 }
639
640 /**
641 * TODO: not implemented currently
642 *
643 * @return
644 */
645 public Boolean getHeaderBarEnabled() {
646 return this.headerBarEnabled;
647 }
648
649 public void setHeaderBarEnabled(Boolean headerBarEnabled) {
650 this.headerBarEnabled = headerBarEnabled;
651 }
652
653 /**
654 * Indicates whether the maintenance action links should be rendered for the invoked lookup view
655 *
656 * <p>
657 * If a maintenance view exists for the data object associated with the lookup view, the framework will add
658 * links to initiate a new maintenance document. This flag can be used to disable the rendering of these links
659 * </p>
660 *
661 * <p>
662 * Note this serves similar purpose to {@link #getSuppressActions()} but the intent is to only remove the
663 * maintenance links in this situation, not the complete actions column TODO: this is not in place!
664 * </p>
665 *
666 * @return boolean true if maintenance links should be shown on the lookup view, false if not
667 */
668 public Boolean getShowMaintenanceLinks() {
669 return this.showMaintenanceLinks;
670 }
671
672 /**
673 * Setter for the show maintenance links indicator
674 *
675 * @param showMaintenanceLinks
676 */
677 public void setShowMaintenanceLinks(Boolean showMaintenanceLinks) {
678 this.showMaintenanceLinks = showMaintenanceLinks;
679 }
680
681 /**
682 * Action component that is used to rendered for the field for invoking the quickfinder action (bringin up the
683 * lookup)
684 *
685 * <p>
686 * Through the action configuration the image (or link, button) rendered for the quickfinder can be modified. In
687 * addition to other action component settings
688 * </p>
689 *
690 * @return Action instance rendered for quickfinder
691 */
692 public Action getQuickfinderAction() {
693 return this.quickfinderAction;
694 }
695
696 /**
697 * Setter for the action field component to render for the quickfinder
698 *
699 * @param quickfinderAction
700 */
701 public void setQuickfinderAction(Action quickfinderAction) {
702 this.quickfinderAction = quickfinderAction;
703 }
704
705 /**
706 * Setter for the light box lookup widget
707 *
708 * @param lightBoxLookup <code>LightBoxLookup</code> widget to set
709 */
710 public void setLightBoxLookup(LightBox lightBoxLookup) {
711 this.lightBoxLookup = lightBoxLookup;
712 }
713
714 /**
715 * LightBoxLookup widget for the field
716 *
717 * <p>
718 * The light box lookup widget will change the lookup behaviour to open the
719 * lookup in a light box.
720 * </p>
721 *
722 * @return the <code>DirectInquiry</code> field DirectInquiry
723 */
724 public LightBox getLightBoxLookup() {
725 return lightBoxLookup;
726 }
727
728 /**
729 * Indicates whether a multi-values lookup should be requested
730 *
731 * @return boolean true if multi-value lookup should be requested, false for normal lookup
732 */
733 public Boolean getMultipleValuesSelect() {
734 return multipleValuesSelect;
735 }
736
737 /**
738 * Setter for the multi-values lookup indicator
739 *
740 * @param multipleValuesSelect
741 */
742 public void setMultipleValuesSelect(Boolean multipleValuesSelect) {
743 this.multipleValuesSelect = multipleValuesSelect;
744 }
745
746 /**
747 * For the case of multi-value lookup, indicates the collection that should be populated with
748 * the return results
749 *
750 * <p>
751 * Note when the quickfinder is associated with a <code>CollectionGroup</code>, this property is
752 * set automatically from the collection name associated with the group
753 * </p>
754 *
755 * @return String collection name (must be full binding path)
756 */
757 public String getLookupCollectionName() {
758 return lookupCollectionName;
759 }
760
761 /**
762 * Setter for the name of the collection that should be populated with lookup results
763 *
764 * @param lookupCollectionName
765 */
766 public void setLookupCollectionName(String lookupCollectionName) {
767 this.lookupCollectionName = lookupCollectionName;
768 }
769 }