org.kuali.rice.krad.uif.widget
Class Suggest

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.component.ComponentBase
              extended by org.kuali.rice.krad.uif.widget.WidgetBase
                  extended by org.kuali.rice.krad.uif.widget.Suggest
All Implemented Interfaces:
Serializable, DictionaryBean, UifDictionaryBean, Component, ScriptEventSupport, Widget, org.springframework.core.Ordered

public class Suggest
extends WidgetBase

Widget that provides dynamic select options to the user as they are entering the value (also known as auto-complete)

Widget is backed by an AttributeQuery that provides the configuration for executing a query server side that will retrieve the valid option values

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
Suggest()
           
 
Method Summary
 String getSourcePropertyName()
          Name of the property on the query result object that provides the options for the suggest, values from this field will be collected and sent back on the result to provide as suggest options
 List<Object> getSuggestOptions()
          When isRetrieveAllSuggestions() is true, this list provides the full list of suggestions
 String getSuggestOptionsJsString()
          Returns the suggest options as a JS String (set by the framework from method invocation)
 AttributeQuery getSuggestQuery()
          Attribute query instance the will be executed to provide the suggest options
 boolean isRetrieveAllSuggestions()
          Indicates whether all suggest options should be retrieved up front and provide to the suggest widget as options locally
 boolean isSourceQueryMethodResults()
          When set to true the results of a query method will be used directly as the suggestions ( it will not be assumed the method returns objects from which the source property name is then used to pull out the suggestions)
 void performFinalize(View view, Object model, Component parent)
          The following actions are performed: Adjusts the query field mappings on the query based on the binding configuration of the field TODO: determine query if render is true and query is not set
protected  void retrieveSuggestOptions(View view)
          Invokes the configured query method and sets the returned method value as the suggest options or suggest options JS string
 void setRetrieveAllSuggestions(boolean retrieveAllSuggestions)
          Setter for the retrieve all suggestions indicator
 void setSourcePropertyName(String sourcePropertyName)
          Setter for the source property name
 void setSourceQueryMethodResults(boolean sourceQueryMethodResults)
          Setter for the source query method results indicator
 void setSuggestOptions(List<Object> suggestOptions)
          Setter for the list of suggest options
 void setSuggestQuery(AttributeQuery suggestQuery)
          Setter for the suggest attribute query
 
Methods inherited from class org.kuali.rice.krad.uif.widget.WidgetBase
getComponentTypeName
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComplexDataAttributesJs, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentSecurityClass, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isSkipInTabOrder, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Component
addCellCssClass, addDataAttribute, addStyleClass, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComplexDataAttributesJs, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setId, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setStyle, setTemplate, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 
Methods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnLoadScript
 

Constructor Detail

Suggest

public Suggest()
Method Detail

performFinalize

public void performFinalize(View view,
                            Object model,
                            Component parent)
The following actions are performed:

Specified by:
performFinalize in interface Component
Overrides:
performFinalize in class ComponentBase
Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
parent - - parent component
See Also:
ComponentBase.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

retrieveSuggestOptions

protected void retrieveSuggestOptions(View view)
Invokes the configured query method and sets the returned method value as the suggest options or suggest options JS string

Parameters:
view - view instance the suggest belongs to, used to get the view helper service if needed

getSuggestQuery

public AttributeQuery getSuggestQuery()
Attribute query instance the will be executed to provide the suggest options

Returns:
AttributeQuery

setSuggestQuery

public void setSuggestQuery(AttributeQuery suggestQuery)
Setter for the suggest attribute query

Parameters:
suggestQuery -

getSourcePropertyName

public String getSourcePropertyName()
Name of the property on the query result object that provides the options for the suggest, values from this field will be collected and sent back on the result to provide as suggest options

Returns:
String source property name

setSourcePropertyName

public void setSourcePropertyName(String sourcePropertyName)
Setter for the source property name

Parameters:
sourcePropertyName -

isSourceQueryMethodResults

public boolean isSourceQueryMethodResults()
When set to true the results of a query method will be used directly as the suggestions ( it will not be assumed the method returns objects from which the source property name is then used to pull out the suggestions)

Note this is not supported for auto queries (only custom method queries). The query method can return a list of Strings which will be used for the suggestions, a list of object with 'label' and 'value' properties, or a custom object (if the plugin has been customized to handle the object)

Returns:
boolean true if the query method results should be used as the suggestions, false to assume objects are returned and suggestions are formed using the source property name

setSourceQueryMethodResults

public void setSourceQueryMethodResults(boolean sourceQueryMethodResults)
Setter for the source query method results indicator

Parameters:
sourceQueryMethodResults -

isRetrieveAllSuggestions

public boolean isRetrieveAllSuggestions()
Indicates whether all suggest options should be retrieved up front and provide to the suggest widget as options locally

Use this for a small list of options to improve performance. The query will be performed on the client to filter the provider options based on the users input instead of doing a query each time

When a query method is configured and this option set to true the method will be invoked to set the options. The query method should not take any arguments and should return the suggestion options List or the JS String as a result. If a query method is not configured the suggest options can be set through configuration or a view helper method (for example a component finalize method)

Returns:
boolean true to provide the suggest options initially, false to use ajax retrieval based on the user's input

setRetrieveAllSuggestions

public void setRetrieveAllSuggestions(boolean retrieveAllSuggestions)
Setter for the retrieve all suggestions indicator

Parameters:
retrieveAllSuggestions -

getSuggestOptions

public List<Object> getSuggestOptions()
When isRetrieveAllSuggestions() is true, this list provides the full list of suggestions

If a query method is configured that method will be invoked to populate this list, otherwise the list should be populated through configuration or the view helper

The suggest options can either be a list of Strings, in which case the strings will be the suggested values. Or a list of objects. If the object does not have 'label' and 'value' properties, a custom render and select method must be provided

Returns:
List list of suggest options

setSuggestOptions

public void setSuggestOptions(List<Object> suggestOptions)
Setter for the list of suggest options

Parameters:
suggestOptions -

getSuggestOptionsJsString

public String getSuggestOptionsJsString()
Returns the suggest options as a JS String (set by the framework from method invocation)

Returns:
String suggest options JS string


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.