AddressControl constructor

AddressControl(
  1. String controlId,
  2. String sheetItemType
)

Constructor to create AddressControl.

Parameters: controlId Unique ID to represent the AddressControl. This ID is used to compare and identify the other SheetControls.

sheetItemType SheetItemType represents billing address or shipping address.

 The possible values are: 
   [SheetItemType.BILLING_ADDRESS] 
   [SheetItemType.ZIP_ONLY_ADDRESS] 
   [SheetItemType.SHIPPING_ADDRESS] 
 It is possible to show only one billing AddressControl and one shipping AddressControl. 

Exceptions: Throws an ArgumentError if controlId is null or empty. Throws an ArgumentError if sheetItemType is not sheetItemType.BILLING_ADDRESS or sheetItemType.ZIP_ONLY_ADDRESS or sheetItemType.SHIPPING_ADDRESS

Implementation

AddressControl(String controlId, String sheetItemType): super(controltype: Controltype.ADDRESS){
  setControlId(controlId);
  if ((sheetItemType == SheetItemType.BILLING_ADDRESS.name) || (sheetItemType == SheetItemType.SHIPPING_ADDRESS.name) || (sheetItemType == SheetItemType.ZIP_ONLY_ADDRESS.name)){
    sheetItem = SheetItem(sheetItemType: sheetItemType);
  } else {
    throw ArgumentError("AddressControl : sheetItemType must be either BILLING_ADDRESS or " + "SHIPPING_ADDRESS or" + "ZIP_ONLY_ADDRESS.");
  }
}