XMADL element : <control>

A screen in the mobile application consists of one or more controls. Controls are user interface (UI) components that occupy a rectangular area on the screen and is responsible for drawing and event handling (including user gestures like TAP). Some controls display information for example TEXT, some can take user inputs like EDIT and others like PUSHBUTTON react to user’s gestures.

Control Attributes

The controls attributes can be grouped as appearance, data source, other
Attributes Description Mandatory Values
name Name identifies the control. If another control wants to include a control as an attribute, then name is used. No user defined
type Describes control type Yes eg: TEXT, EDIT, WEBVIEW, LIST etc.. Learn more on Controls
  Position Related    
x

Specifies x position (distance from the left edge of the parent control). Parent control could be screen as well. It can be expressed in percentage, or pixels (px) or device pixels (dp).

By default width in percentage is relative to its parent control. It can be made relative to screen using attribute dimensions_relative_to=”SCREEN” in screen_deck . Learn more about dimensions

Yes

eg: x=”2” defines that the control will start from 2% (of the total screen width) from left side of screen

iOS supports default only (px and dp coming soon) Default is percentage without % symbol

y

Specifies y position (distance from the top edge of the parent control). Parent control could be screen as well. It can be expressed in percentage, or pixels (px) or device pixels (dp).

By default width in percentage is relative to its parent control. It can be made relative to screen using attribute dimensions_relative_to=”SCREEN” in screen_deck . Learn more about dimensions

Yes

eg: y=”2” defines that the control will start from 2% from top of screen

iOS supports default only (px and dp coming soon) Default is percentage without % symbol

width

Specifies the width of the control in percentage or pixels (px) or device pixels (dp).

By default width in percentage is relative to its parent control. It can be made relative to screen using attribute dimensions_relative_to=”SCREEN” in screen_deck . Learn more about dimensions

Yes
eg: width=”80” (default) OR width=”80%”
width=”80px”, width=”80dp”

iOS supports default only (px and dp coming soon) Default is percentage without % symbol

height

Specifies the height of the control in percentage or pixels (px) or device pixels (dp).

By default width in percentage is relative to its parent control. It can be made relative to screen using attribute dimensions_relative_to=”SCREEN” in screen_deck . Learn more about dimensions

Yes
eg: height=”80” (default) OR height=”80%”
height=”80px”, height=”80dp”

iOS supports default only (px and dp coming soon) Default is percentage without % symbol

  Appearance Related    
appearance_name Gives the appearance name for the control as defined in appearance.xml. Yes  
word_wrap Specifies if the control can be word-wrapped if the width of text exceeds the width of the control. No

word_wrap=”1” means word wrap is on

word_wrap = “0” means word wrap is off

ellipsized Specifies if the text can be ellipsized if the width of the text exceeds the width of the control. No

ellipsized=”1” means ON

ellipsized=”0” means OFF

is_visible By default all controls created are visible on the screen Setting is_visible=”0” makes it invisible. No

is_visible = “1” (Default)

is_visible=”0”

  Data Sourcing Related    
permission Specifies type of permission for the control. EDIT, CHECKBOX may will have a default permission=”READWRITE” No

permission = “READONLY” (Default)

permission = “READWRITE”

default_value Static data is displayed using this attribute No The default value MUST match the format_type if given.
field_name When the data is fetched from the previous action, local or remote data source, field_name is used to identify the data applicable for this control. No  
data_type Defines the type of data applicable for this control. (static or dynamic) Dependent on Control type eg: VARCHAR, INT, FLOAT, DATE
format_type Defines if display format. For ex., if the DATE is to displayed as Jan 1, 2013 the format_type will be ‘MMM dd, yyyy’ No  
storage_format When format type of data is different than how it is stored in local data table, storage_format can be used No data_type=DATE can have a storage_format=”yyyy-MM-dd”, but a display format=”MM/dd/yyyy”.
size Declares field length. For controls that take user input like EDIT, PASSWORD MUST have the size defined. The size determines how many characters are to be read from the control No A positive integer
local_data_source Defines local data source for this control No SQL Query that fetches data from local database. See Attributes defining data source for control
remote_data_source Defines url from where the control needs to get the data No user defined url. See Attributes defining data source for screen
remote_request_type Defines type of remote request for the server No

GET (default)

POST

PUT

DELETE

remote_data_format This defines the format of data received back after executing the URL Values are JSON, IMAGE. Default is JSON. No  
remote_data_save _locally

This attribute directs AVM to save the remote data locally as well before passing it to the control. If the server response is JSON, AVM will attempt to save the data locally. See section Fetch local data in XMADL control element.

Note: Local Data is always fetched after the remote data is fetched. So if remote data is first saved into the local database then the local data fetch will get the latest and greatest data.

   
on_resume_update Defines if the data needs to be fetched again when the screen resumes. The screen resumes after being created or when it comes to foreground again. No

0 - data will not be refreshed (Default)

1 - data will be fetched again

  Others    
os You can associate a control with a specific market place. For example, some controls are needed only when the app runs on Apple powered devices. No

255 - all platforms (Default)

1 - Apple only

2 - Google only

4 - Amazon only

6 - Google and Amazon devices

mark_deleted This is equivalent to commenting out the control. You can as well comment the XML that defines this control. No

0 - not deleted (default)

1 - delete

Good Read

Appearance

Working with data