|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ebasetech.xi.services.PostcodeAnywhereServices
public class PostcodeAnywhereServices
PostcodeAnywhereServices
provides static methods to access the PostcodeAnywhere service.
Constructor Summary | |
---|---|
PostcodeAnywhereServices()
|
Method Summary | |
---|---|
static java.lang.String[] |
getAddressConstituentParts(java.lang.String addressId)
Returns an array of address details for an address id, as provided by method getCandidateAddresses(String) . |
static java.lang.String[][] |
getCandidateAddresses(java.lang.String postCode)
Returns an array of list entries for postCode using the PostcodeAnywhere service provider. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PostcodeAnywhereServices()
Method Detail |
---|
public static java.lang.String[][] getCandidateAddresses(java.lang.String postCode) throws com.ebasetech.xi.exceptions.FormRuntimeException, com.ebasetech.xi.exceptions.InvalidPostcodeException
postCode
using the PostcodeAnywhere service provider. Each list entry
consists of an array containing two Strings that correspond to the list display value and the list returned value.
See FieldList.getDisplayValues(boolean)
for more information on list values.
This postcode lookup service provides a two stage user interface:
getAddressConstituentParts(String)
to get the list detailsJavascript example:
try { var addresses = PostcodeAnywhereServices.getCandidateAddresses(postcode); if (addresses.length == 0) { event.owner.addErrorMessage("Invalid postcode. Please enter a valid postcode"); } else { var list = fields.ADDRESSES.createCustomList(); for each (var address in addresses) { list.add(address[0], address[1]); } fields.ADDRESSES.fieldControl.show(); } } catch (e) { event.owner.addErrorMessage(e.javaException.message); }
postCode
- post code
com.ebasetech.xi.exceptions.InvalidPostcodeException
- if postCode
is not a valid post code
com.ebasetech.xi.exceptions.FormRuntimeException
- if any other error occurs e.g. unable to access the PostcodeAnywhere remote UrlgetAddressConstituentParts(String)
public static java.lang.String[] getAddressConstituentParts(java.lang.String addressId) throws com.ebasetech.xi.exceptions.FormRuntimeException
getCandidateAddresses(String)
.
In the UK, the address details consists of an array of Strings as follows:
addressId
- is the returned list value as provided by method getCandidateAddresses(String)
com.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs e.g. unable to access the PostcodeAnywhere remote Url
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |