Change the screen or menu layout dynamically
While a single optimized screen layout is often sufficient, dynamically varied layouts can be helpful in certain applications.
Implement the different layouts in their own include files. Using a GuiXT status variable whose content is part of the include name, you control which layout should be active.
Example 1: Dynamic screen layout
We design the simplified data entry of a new customer. As the required information differs for domestic, European and international customers, we offer the user a dropdown box to specify the customer's region and then design the screen to suit this type of customer: the right set of entry fields, appropriate maximum field length, default values and specific search help.
We use a status variable V[customertype] which can be set to "dom" for "domestic", "eur" for "european" or "gen" for "general" via a dropdown selection. To change the screen layout immediately when the user selects the customer type we use the "process=" option of the "dropdownlist" ommand:
Depending on the customer type we then use an "include" to display the appropriate layout.
// Customer type selection
Text(3,6) "Please select the customer type" size=32 -label
"dom=Domestic customer;eur=European customer;gen=General customer"
DropDownList(3,38.7) "customertypes" width=30 _
// include appropriate screen layout for selected customer type
InputField(9,7) "Name" (9,27) size=30 name="name1"
InputField (10,27) -nolabel size=30 name="name2"
InputField (11,27) -nolabel size=30 name="name3"
InputField (12,27) -nolabel size=30 name="name4"
InputField (13,7) "Street" (13,27) size=30 name="street"
InputField (14,7) "City" (14,27) size=30 name="city"
Example 2: Dynamical menu
The SAP menu has been moved slightly to the right to make room for new buttons that lead to the respective menu parts.
In this two-dimensional menu ithe user can either choose one of the transactions or navigate to further detailed menus:Implement the various menu parts in their own include files. Use a GuiXT status variable, e.g.
V[menustatus], which you change when the user clicks on one of the navigation buttons. Then include the right menu part using a dynamic include name, similar to Example 1: