Every time the user chooses something in Address Helper, the event selectionChangeEvent is fired. To listen for this event, use the following syntax:

   // Check the result

Read more about the methods including the object getSelectedAddress() returns.


   // Check the result

Example implementation for dynamic styling of floor/flat

This example uses wrappers for floor and flat to better guide the user. Depending on the selected address the user might be prompted for more details (from the default skin)

diah.selectionChangeEvent.subscribe(function() {
    var address = this.getSelectedAddress(),
        completeWithoutFloors = this.isComplete() && address.floor == -1,
        showFloor = address.streetNumber!=null && !address.streetNumber.ignoreHouseholds(),
        showHousehold = showFloor && address.floor!=null && address.household != -1,
        floorWrapper = $Q('.floorInputWrapper', element, true),
        householdWrapper = $Q('.householdInputWrapper', element, true); = 'none'; = 'none';

    if (showFloor && !completeWithoutFloors) { = 'inline-block'; = 'inline-block'; = showHousehold ? '1' : '.2';
}, this, true);


Checking for coverage (for the selected address) of an distributed product.
If distributionSupport-config is used, this event will trigger each time we have done a coverage check for the given product/customersystem.
To listen for this event, use the following syntax:

diah.productSupportEvent.subscribe(function(e, args){ 
   var data = args[0];
   // Check the data for:
   // data.hasSupport
   // data.hasKeyDeviation
   // data.keyDeviation
   // data.deliveryPlace
   // data.distrDate