Show TOC Entering content frame

Procedure documentation Defining a Static-Text Control Locate the document in its SAP Library structure

Use

You use this procedure to define the properties and event handlers for a static-text control. A static-text control is used to display information on a mobile application. They can be used to:

·        Display text that does not change at runtime.

Example

Displaying the character, %, at the end of a percentage field.

·        Display read-only text that changes based on the property associated with it.

Example

Displaying a version number in the About dialog box.

A static-text control:

·        Can be used in a Detail or a List tile

·        Cannot be included in a grid

·        Can be bound (associated with a data source property) or left unbound

·        Can be associated with a hyperlink

Prerequisites

You have:

·        Added a static-text control in a tile

·        Identified the data source property that you want to associate with the static-text control

Note

Ensure the data source property is assigned the Text data attribute.

·        Identified the business anchor that references the data source to which the required property belongs

Note

The business anchor name includes the data source it references.

·        Switched to the required change list

Procedure

...

       1.      In the Solution Explorer, locate the tile for which you want to design the static-text control, click the tile with the secondary mouse button, and choose View Designer.

The Tile Designer window appears.

       2.      If you do not want the static text to change dynamically, continue with step 3. If you want the static text to change dynamically, in the Document Outline window Anchors view, drag the control and drop it on the anchor containing the data source property that you want to display at runtime.

       3.      In the Tile Designer, select the control.

The Properties panel displays the values for the static-text control’s properties.

       4.      In the Properties panel, enter the appropriate values for the control properties.

For information on each of the properties, see Properties of a Static-Text Control.

       5.      If you do not need to create a hyperlink, continue with step 6. If you want to create a hyperlink, click the control with the secondary mouse button and choose View Hyperlinks.

For more information, see Model a Hyperlink.

       6.      If you do not need to create an event handler, continue with step 7. If you want to create an event handler, perform the following steps:

...

                            a.      In the Tile Designer, click the control with the secondary mouse button and choose Add Handler.

The New Event Handler dialog box appears with default values in the fields.

                            b.      In the Event field, select the event you want to use.

The following table provides information about the events.

Event Name

Description

onBoundAttributeChanged

The value of the assigned BO changes.

onHyperlinkClicked

The user chooses the hyperlink. This event occurs before the hyperlink is executed.

onValueChanged2

The value of the static-text field changes.

Caution

The onValueChanged event is not supported in this release. Use onValueChanged2 event.

                            c.      Select Edit this handler code after creation and choose OK.

                            d.      In the TODO section, enter the code you require for the event handler.

                            e.      Save the code.

       7.      Save your entries.

Result

You have defined a static-text control by specifying the properties and event handlers.

See also:

 

Adding Controls to a Tile

Defining a Multi-Line Input Control

Defining a Text-Input Control

 

Leaving content frame