EchoPoint
2.1.0rc4

echopointng.text
Interface AutoLookupModel


public interface AutoLookupModel

The AutoLookupModel provides for support for looking up AutoLookupModel.Entry's based on partial-string matching.

Client Side Caching

A cache of values will be kept on the client, depending on the values of maximumCacheAge and maximumCacheSize.

The client cache uses a combination of Entry value, sortValue and XhtmlFragement to produce a unique key for the AutoLookupModel.Entry. This is then used to keep unique copies of the entries in the client side cache and duplicates will not be shown.

If you have values that map to one of more display values (such as postcode) then you should ensure that the value/sortValue/xhtml combination is indeed unique.


Nested Class Summary
static class AutoLookupModel.DefaultEntry
          A simple implementation of AutoLookupModel.Entry is provided.
static interface AutoLookupModel.Entry
          AutoLookupModel.Entry represents the entries that can be returned by the AutoLookupModel.
 
Field Summary
static int MATCH_IS_CASE_SENSITIVE
          When this match option is in used, the lookup matching is case sensitive.
static int MATCH_ONLY_FROM_START
          When this match option is in used, the lookup matching is expected to only match from the start of the value string.
 
Method Summary
 int getMatchOptions()
           
 int getMaximumCacheAge()
           
 int getMaximumCacheSize()
           
 AutoLookupModel.Entry[] prePopulate()
          This is called to prepopulate a cache of AutoLookupModel.Entry's on the client.
 AutoLookupModel.Entry[] searchEntries(java.lang.String partialSearchValue, int matchOptions)
          This is called to populate a cache of AutoLookupModel.Entry's on the client based on the partial search value
 

Field Detail

MATCH_ONLY_FROM_START

public static final int MATCH_ONLY_FROM_START
When this match option is in used, the lookup matching is expected to only match from the start of the value string. By default matching is anywhere in the value string.

See Also:
Constant Field Values

MATCH_IS_CASE_SENSITIVE

public static final int MATCH_IS_CASE_SENSITIVE
When this match option is in used, the lookup matching is case sensitive. By default the matching is case insensitive.

See Also:
Constant Field Values
Method Detail

getMaximumCacheAge

public int getMaximumCacheAge()
Returns:
the maximum age in milliseconds of entries that are allowed to be cached on the client from this model. A value of -1 means that the entries never expire.

getMaximumCacheSize

public int getMaximumCacheSize()
Returns:
the maximum number of entries that are allowed to be cached on the client from this model. A value of -1 means that the number of entries is unlimited.

getMatchOptions

public int getMatchOptions()
Returns:
the current match options which can be one of the following values OR'ed together:
  • MATCH_ONLY_FROM_START - match from the start of the search value
  • MATCH_IS_CASE_SENSITIVE - matching is case senstive

prePopulate

public AutoLookupModel.Entry[] prePopulate()
This is called to prepopulate a cache of AutoLookupModel.Entry's on the client.

Returns:
a NON-NULL array of AutoLookupModel.Entry's. This may be zero length but may not be null.

searchEntries

public AutoLookupModel.Entry[] searchEntries(java.lang.String partialSearchValue,
                                             int matchOptions)
This is called to populate a cache of AutoLookupModel.Entry's on the client based on the partial search value

Parameters:
partialSearchValue - - the partial search value to use
matchOptions - - the matching options in play which can be on of the following values:
  • MATCH_ONLY_FROM_START - match from the start of the search value
  • MATCH_IS_CASE_SENSITIVE - matching is case senstive
Returns:
a NON-NULL array of AutoLookupModel.Entry's. This may be zeor length but may not be null.

EchoPoint
2.1.0rc4