Configuring autofill and autocompletion in address-config.xml
To configure the fields that support address autofill and autocompletion for a country, configure that country’s address-config.xml file.
PolicyCenter stores address-config.xml files in country-specific folders under the geodata folder, which you can access in Guidewire Studio. For example, the address-config.xml file for Japan is stored in the following folder:
The following default configuration for the United States, in , shows elements that you can use in this file:
<AddressDef name="US">
<Match>
<Field name="Country" value="US"/>
</Match>
<Fields>
<Field name="City" zonecode="city">
<AutoFillFromZone code="zip"/>
<AutoFillFromZone code="state"/>
</Field>
<Field name="County" zonecode="county">
<AutoFillFromZone code="zip"/>
<AutoFillFromZone code="city"/>
<AutoFillFromZone code="state"/>
</Field>
<Field name="State" zonecode="state">
<AutoFillFromZone code="zip"/>
<AutoFillFromZone code="city"/>
</Field>
<Field name="PostalCode" zonecode="zip">
<AutoFillFromZone code="city"/>
<AutoFillFromZone code="state"/>
<ValidatorDef
value="[0-9]{5}(-[0-9]{4})?"
description="Validator.PostalCode.US"
input-mask="#####-####"/>
</Field>
</Fields>
</AddressDef>
The following table describes the elements in the address-config.xml file.
|
The name of the address
format. This element takes a A country can have
more than one address format—for example, it is possible that different
regions have different formats. The |
|
Each |
|
Each |
|
Specifies an address
field. Each field takes a name that must match a property on the Address entity. The In the In
the
|
|
Specifies a field
that is examined for autofill and autocompletion of the field. PolicyCenter uses the zone |
|
Contains information
for validating the field in the optional attributes Note: Do not define field validators in address-config.xml. Guidewire recommends that you define them in fieldvalidators.xml. See Field validation. |
The previous address-config.xml example defines
a Match on the country
with the match value as US.
Additionally, it defines four fields:
CityCountyStatePostalCode
Each field defines one or more AutoFillFromZone elements. Looking
at the County, you can
see that the application fills the County
from the zip, the city, and the state. Each AutoFillFromZone entry must correspond
to a <Link> definition
in zone-config.xml, as
described in Zone configuration files. That file specifies that
autofill can use ZIP code and city for the look-up operation.
As PolicyCenter loads address-config.xml, it validates
the configuration. PolicyCenter
verifies that every Field
element, regardless of whether it is defined in Match or Fields, corresponds to a field
on the Address entity.
Then, PolicyCenter verifies that
each AutoFillFromZone
element references a zone in zone-config.xml.
See also
