Class LocationSuggest

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, Ordered, ScriptEventSupport, LifecycleElement, Widget, org.springframework.core.Ordered

public class LocationSuggest extends Suggest
LocationSuggest widget for providing suggestions that represent locations. When the suggestion is clicked, the navigation occurs immediately.
See Also:
  • Constructor Details

    • LocationSuggest

      public LocationSuggest()
  • Method Details

    • performFinalize

      public void performFinalize(Object model, LifecycleElement parent)
      Process the objectIdPropertyName, if set 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
      The following finalization is done here:
      • progressiveRender and conditionalRefresh variables are processed if set
      • If any of the style properties were given, sets the style string on the style property
      • Set the skipInTabOrder flag for nested components
      The last phase before the view is rendered

      Here final preparations can be made based on the updated view state.

      Specified by:
      performFinalize in interface LifecycleElement
      Overrides:
      performFinalize in class Suggest
      Parameters:
      model - - top level object containing the data
      parent - - parent component
    • getPostData

      Returns object containing post data to store for the suggest request.
      Overrides:
      getPostData in class Suggest
      Returns:
      suggest post data instance
    • getBaseUrl

      public String getBaseUrl()
      BaseUrl for the suggestions. Unless the suggestion contains an href, baseUrl + additionalUrlPath value + request parameters is used to generate the url.
      Returns:
      the baseUrl
    • setBaseUrl

      public void setBaseUrl(String baseUrl)
      Set the baseUrl
      Parameters:
      baseUrl -
    • getAdditionalUrlPathPropertyName

      public String getAdditionalUrlPathPropertyName()
      AdditionalUrlPathProperty specifies the property on the retrieved suggestion result that contains a url appendage to be appended to the baseUrl when this selection is chosen.

      One use case for setting this is to retrieve a controllerMapping that changes based on selection. Note: for suggestions that all point to the same controllerMapping, simply set it as part of the baseUrl.

      Returns:
      the additionalUrlPathPropertyName
    • setAdditionalUrlPathPropertyName

      public void setAdditionalUrlPathPropertyName(String additionalUrlPathPropertyName)
      Set additionalUrlPathProperty
      Parameters:
      additionalUrlPathPropertyName -
    • getHrefPropertyName

      public String getHrefPropertyName()
      The hrefPropertyName specifies the property on the retrieved suggestion result that contains the href value (full url).

      This property must contain a full url if it exists on the object. If this property name is matched on the suggestion result, it takes precedence over any other settings set on this locationSuggest and is used as the navigation url. If the property name does not exist on the object, the suggest will fall back to building the url dynamically with baseUrl.

      Returns:
      the hrefPropertyName
    • setHrefPropertyName

      public void setHrefPropertyName(String hrefPropertyName)
      Set the hrefPropertyName
      Parameters:
      hrefPropertyName -
    • getObjectIdPropertyName

      public String getObjectIdPropertyName()
      The objectIdPropertyName that represents the key for getting the object as a request parameter. The property will be added to the request parameters by the name given with the value pulled from the result object.

      This convenience method is essentially equivalent to having a property by objectIdPropertyName as a key and value in the requestParameterPropertyNames.

      Returns:
      the objectIdPropertyName which represents which property is the "key" of the object
    • setObjectIdPropertyName

      public void setObjectIdPropertyName(String objectIdPropertyName)
      Set the objectIdPropertyName
      Parameters:
      objectIdPropertyName -
    • getRequestParameterPropertyNames

      public Map<String,String> getRequestParameterPropertyNames()
      RequestParameterPropertyNames specify the properties that should be included in the request parameters.

      The key is used as the key of the request parameter and the value is used as the property name to look for in the suggestion result object. If the property name specified exists on the result object, the request parameter in the url will appear as key=propertyValue in the request parameters.

      Returns:
      the RequestParameterPropertyNames map with key and property names
    • setRequestParameterPropertyNames

      public void setRequestParameterPropertyNames(Map<String,String> requestParameterPropertyNames)
      Set the requestParameterPropertyNames
      Parameters:
      requestParameterPropertyNames -
    • getAdditionalRequestParameters

      public Map<String,String> getAdditionalRequestParameters()
      AdditionalRequestParameters specify the static(constant) request parameters that should be appended to the url.

      The key represents the key of the request parameter and the value represents the value of the request parameter. This will be used on each suggestion which uses a generated url (using baseUrl construction).

      Returns:
      mapping of additional request parameters
    • setAdditionalRequestParameters

      public void setAdditionalRequestParameters(Map<String,String> additionalRequestParameters)
      Get the additionalRequestParameters
      Parameters:
      additionalRequestParameters -
    • getRequestParameterPropertyNameJsObject

      public String getRequestParameterPropertyNameJsObject()
      Gets an object translated to js for the requestParameterPropertyNames. Used to construct the url on the client.
      Returns:
      the requestParameterPropertyNames js map object
    • getAdditionalRequestParameterString

      public String getAdditionalRequestParameterString()
      Gets the constant additionalRequestParameters as a request string value to use as part of the url
      Returns:
      the request parameter string for additionalRequestParameters