Show TOC

Address ControlLocate this document in the navigation structure

Use the address control to present and edit address information. It is implemented as single view that contains many fields. The field layout is determined by the country selected in the address.

In edit mode the user can:
  • Tap the street number or zip code fields to show the numerical keypad.
  • Tap the street name or city name to show an alphanumerical keypad.
  • Tap the country to show a value help in a dialog view that contains the default values of all the countries known by the locale framework.

The MAFAddressView control is a complex reusable control, which means that is built on top of the MAFTextView, MAFEditText, MAFSpinnerButton, and MAFFilterDialog simple controls, extends their capabilities, and adds styling capabilities to the Address UI component.

MAFAddressView has two modes: a display (read only) mode, and an editing (input) mode.

To create and present these views in default SAP style, use this code:
private MAFAddressView inputAddressView;
private MAFAddressView displayAddressView;
inputAddressView = new MAFAddressView(this, "ADDRESS", true);
displayAddressView = new MAFAddressView(this, "ADDRESS", false);
To create an MAFAddressView in the Android layout XML in input mode, use:
                android:visibility="visible" />
You cannot create MAFAddressView in the XML in display mode.

The MAF skinning engine customizes the address. To apply SAP style, set the custom style in the XML file for background, foreground, shadow, font family, and font size. Because this is a complex control which consists of four simple controls, you have to set all four TargetTypes.

See these topics for the XAML contents, for the TargetTypes MAFCurrencyView uses, and for the properties you can set in the skinning XML for MAFCurrencyView: MAFTextView, MAFEditText, MAFSpinnerButton, and MAFFilterDialog.

You can also inherit the style definition from the standard Address and create a flavored version. Here is an example for a red address flavor:
<Style TargetType="Label" Key="RedAddressView" BasedOn="DefLabel" platform="android">
<Style TargetType="TextBox" Key="RedAddressView" BasedOn="DefTextBox" platform="android">
<Style TargetType="ComboBox" Key="RedAddressView" BasedOn="SpinnerDef" platform="android">
After creating the custom styles, you can create a flavored address from code:
inputAddressView = new MAFAddressView(this, "ADDRESS", true, "RedAddressView");