You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UI5 offers popups and popovers that overlay specific parts of the view. This section walks through building them in abap2UI5.
6
+
UI5 offers popups that overlay specific parts of the view. This section walks through building them in abap2UI5.
7
7
8
-
### Popup
9
-
10
-
#### General
8
+
## General
11
9
12
10
To show a popup, call `client->popup_display` instead of `client->view_display`:
13
11
```abap
@@ -21,7 +19,7 @@ To show a popup, call `client->popup_display` instead of `client->view_display`:
21
19
ENDMETHOD.
22
20
```
23
21
24
-
####Flow Logic
22
+
## Flow Logic
25
23
A typical popup flow shows a normal view, opens a popup, and finally closes it. Structure it like this:
26
24
```abap
27
25
METHOD z2ui5_if_app~main.
@@ -55,7 +53,7 @@ A typical popup flow shows a normal view, opens a popup, and finally closes it.
55
53
ENDMETHOD.
56
54
```
57
55
58
-
####Separated App
56
+
## Separated App
59
57
For a cleaner source layout, encapsulate popups in separate classes and call them via [navigation](/development/navigation/navigation).
60
58
61
59
An example with the confirmation popup:
@@ -83,63 +81,3 @@ An example with the confirmation popup:
83
81
```
84
82
85
83
To handle multiple stacked popups, note that abap2UI5 shows only one popup at a time on the frontend. But you can keep a popup stack in your backend logic and re-display the previous popup as needed. See `Z2UI5_CL_DEMO_APP_161`.
86
-
87
-
### Popover
88
-
To show a popover, call `client->popover_display` and pass the ID of the control the popover should attach to:
89
-
```abap
90
-
METHOD z2ui5_if_app~main.
91
-
92
-
IF client->check_on_init( ).
93
-
DATA(view) = z2ui5_cl_xml_view=>factory(
94
-
)->shell(
95
-
)->page( `Popover Example`
96
-
)->button(
97
-
text = `display popover`
98
-
press = client->_event( `POPOVER_OPEN` )
99
-
id = `TEST` ).
100
-
client->view_display( view->stringify( ) ).
101
-
102
-
ENDIF.
103
-
104
-
CASE client->get( )-event.
105
-
106
-
WHEN `POPOVER_OPEN`.
107
-
DATA(popover) = z2ui5_cl_xml_view=>factory_popup(
108
-
)->popover( placement = `Left`
109
-
)->text( `this is a popover`
110
-
)->button(
111
-
id = `my_id`
112
-
text = `close`
113
-
press = client->_event( `POPOVER_CLOSE` ) ).
114
-
client->popover_display(
115
-
xml = popover->stringify( )
116
-
by_id = `TEST` ).
117
-
118
-
WHEN `POPOVER_CLOSE`.
119
-
client->popover_destroy( ).
120
-
ENDCASE.
121
-
122
-
ENDMETHOD.
123
-
```
124
-
125
-
### Built-in Popups
126
-
A few pre-built popup classes cover the most common cases:
127
-
128
-
-`Z2UI5_CL_POP_ERROR`
129
-
-`Z2UI5_CL_POP_FILE_DL`
130
-
-`Z2UI5_CL_POP_FILE_UL`
131
-
-`Z2UI5_CL_POP_GET_RANGE`
132
-
-`Z2UI5_CL_POP_GET_RANGE_M`
133
-
-`Z2UI5_CL_POP_HTML`
134
-
-`Z2UI5_CL_POP_INPUT_VAL`
135
-
-`Z2UI5_CL_POP_ITAB_JSON_DL`
136
-
-`Z2UI5_CL_POP_JS_LOADER`
137
-
-`Z2UI5_CL_POP_MESSAGES`
138
-
-`Z2UI5_CL_POP_PDF`
139
-
-`Z2UI5_CL_POP_TABLE`
140
-
-`Z2UI5_CL_POP_TEXTEDIT`
141
-
-`Z2UI5_CL_POP_TO_CONFIRM`
142
-
-`Z2UI5_CL_POP_TO_INFORM`
143
-
-`Z2UI5_CL_POP_TO_SELECT`
144
-
145
-
Help expand this collection to cover more cases — contributions are welcome.
0 commit comments