Show TOC Entering content frame

Procedure documentation Defining a Choice-List Control Locate the document in its SAP Library structure

Use

You use this procedure to define the properties and event handlers for a choice-list control. A choice-list control allows you to select an object from a popup screen at runtime.

A choice-list control:

·        Can be used on any type of tile

·        Can be associated with a hyperlink

Prerequisites

You have:

·        Added a choice-list control in a tile

·        Identified the data source property you want to associate with the choice-list control

·        Identified the business anchor referencing the data source you want to use

·        Determined which popup window is to display when the control is chosen

·        Identified the business anchor associated with the popup window

·        Identified the property from the popup window’s data source that you want to display in the control’s input field (display attribute)

·        Identified the primary key of the tile’s data source with which to associate the primary key returned by the popup window’s business object (target attribute)

Procedure

...

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

The Tile Designer window appears.

       2.      Select the choice-list control.

The Properties panel displays the values for the Browser control’s properties.

       3.      In the Properties panel, enter the appropriate values for the choice-list control.

For information on each of the properties, see Properties of a Choice-List Control.

       4.      If you do not need to create a hyperlink, continue with step 5. 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.

       5.      If you do not need to create an event handler, continue with step 6. 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 for the associated BO changed.

onBtnClicked

The user chooses the choice-list control pushbutton. This event occurs before the choice popup window appears.

onCanceled

 

 

The user chooses the Cancel pushbutton on the popup window. In the event handler, you can access the popup tile set’s anchor and its custom data.

onHyperlinkClicked

The user selects a hyperlink. This event occurs before the hyperlink executes.

onQuery

The user selects choice-list pushbutton or the user moves the focus to a different control.

OnSelected

The user selects an item from the choice-list control. The event contains the selected item. The selected item can be changed by the event handler.

onValueChanged2

The value of choice-list control is changed.

Caution

The following table contains events which are not supported in this release. Choose the event in the Use event column for your code.

Unsupported event

Use event

onChoiceBtnClicked

onBtnClicked

onChoiceWindowClosed

onSelected

onValueChanged

onValueChanged2

                            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.

3.       Save your entries.

Result

You have defined a choice-list control by specifying the properties and event handlers.

See also:

 

Adding Controls to a Tile

Leaving content frame