!--a11y-->
Creating the Simple Types
Among other things, simple types are suitable for encapsulating frequently used texts that are defined in the Layout Editor at design time.
Figure 1 shows you an example of how to use a simple type. The ReturnDate simple type has the type date and encapsulates the texts Return Date (a label text) and Choose a date (a quick info text). You can now assign various context attributes to this simple type, such as ReturnDate. The context attribute can itself be bound with an input field. In this way, the quick info text of the simple type is used for the input field. If you define a label for the input field (you must set the labelFor property for the label), the label text of the simple type is used.

You can also define enumerations for simple types. You can also assign this simple type to a context attribute, and bind it to a dropdown list. In this way, all values included in the simple type can be displayed in the dropdown list.
Simple Type Enumeration Dropdown List

To display selection options in the dropdown list for the vehicle type, add the simple type VehicleType to the application.
...
1. In the TutWD_Languages_Init project, open the Data Types node (choose TutWD_Languages_Init ® Dictionaries ® Local Dictionary ® Data Types).
2.
Open the context
menu for the Simple Types node and choose
Create
Simple Type.
3. Under Simple Type Name, enter VehicleType. Under Package, enter com.sap.tut.wd.languages.simpletypes. Choose Finish to confirm.
The editor for the new simple type VehicleType opens automatically.
4. Choose the Enumeration tab page.
5. To add a new enumeration, choose New...
6. Under Enumeration Value, enter E. Under Enumeration Text, enter Economy. Choose Finish to confirm.
7. Repeat steps 5 and 6 to create more enumerations.
Value |
Description |
B |
Business Class |
F |
First Class |
C |
Cabriolet |
V |
Van |
8. Switch to the Representation tab page.
9. Under Field Label, enter Vehicle Type.

Later, this value is used as the default value for the corresponding label. (Column Label defines the default value for a table header.)
10. Under Quick Info:, enter Choose a vehicle type.

This text is used as the default value for the quick info.
To display selection options in the dropdown list for the pickup location, add the simple type Location to the application.
11. Repeat steps 2-10 to create the simple type Location in the package com.sap.tut.wd.languages.simpletypes. Use the following properties:
Enumeration |
|
Value |
Description |
HD |
Heidelberg |
F |
Frankfurt |
B |
Berlin |
M |
Munich |
Representation |
|
Field Label |
Pickup Location |
Quick Info |
Choose a pickup location. |
To make it clearer how you encapsulate frequently used interface element texts in a simple type, create the simple type ReturnDate.
12. Create the simple type ReturnDate in the package com.sap.tut.wd.languages.simpletypes.
13. Switch to the Definition tab page and choose date in the dropdown list for the build-in. Choose OK.
14. Switch to the Representation tab page. Under Field Label, enter Return Date. Under Quick Info, enter Choose a date.
You have created the three simple types Location, ReturnDate, and VehicleType:

Creating the Context and Action
