Configuring autofill and autocompletion in a PCF file
You can configure autofill and autocomplete after you have configured zone mapping and
addressing and have imported your zone data. PolicyCenter
uses the following main classes for address autofill and autocompletion.
- gw.api.contact.AddressAutocompleteHandler
- Class provides methods for getting matching values from the database.
- gw.api.contact.AddressAutocompleteUtil
- Class supplies methods for automatically completing an address field.
You can integrate autofill and autocompletion into a PCF file in the following ways.
- Complete a field automatically after you type in a few characters
- For example, if you enter
941for the ZIP code, the autocomplete list shows94110,94111,94112, and so forth. - Fill other address fields after you complete a field and tab out of it
- For example, after you enter the ZIP code
94115, autofill can fill in the city, county, and state asSan Francisco,San Francisco,andCaliforniarespectively. This level of autofill happens only if there is a unique match between the fields. For example, with San Francisco as the city and California as the state, autofilling the ZIP code would not work because San Francisco has multiple ZIP codes. This matching is done in the default autocompletion and autofill plugin, matching between the fields and the zone definitions. - Force an override of already filled fields
- By default, if a field already has a value, PolicyCenter does not overwrite it. You can force
it to override the field value with zone data by using a method on
AddressAutocompleteUtilto autofill the address.
In addition, there are two PCF widgets that you can use to support autofill:
AddressAutoFillRangeAddressAutoFillInput
Both widgets provide a small icon for autofilling the fields on demand.
