Skip to content

Commit 3872c9d

Browse files
committed
Split Popups, Popovers page into submenu with three pages
Replace the single popups.md with a submenu containing dedicated pages for Popups, Popover and Built-In popups so each topic gets its own entry in the sidebar.
1 parent c796612 commit 3872c9d

4 files changed

Lines changed: 81 additions & 68 deletions

File tree

docs/.vitepress/config.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,16 @@ export default defineConfig({
162162
],
163163
},
164164
{ text: "Translation, i18n", link: "/development/translation" },
165-
{ text: "Popups, Popovers", link: "/development/popups" },
165+
{
166+
text: "Popups, Popovers",
167+
link: "/development/popups/popups",
168+
collapsed: true,
169+
items: [
170+
{ text: "Popups", link: "/development/popups/popups" },
171+
{ text: "Popover", link: "/development/popups/popover" },
172+
{ text: "Built-In", link: "/development/popups/built_in" },
173+
],
174+
},
166175
{
167176
text: "Browser Features",
168177
collapsed: true,
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
outline: [2, 4]
3+
---
4+
# Built-In Popups
5+
6+
A few pre-built popup classes cover the most common cases:
7+
8+
- `Z2UI5_CL_POP_ERROR`
9+
- `Z2UI5_CL_POP_FILE_DL`
10+
- `Z2UI5_CL_POP_FILE_UL`
11+
- `Z2UI5_CL_POP_GET_RANGE`
12+
- `Z2UI5_CL_POP_GET_RANGE_M`
13+
- `Z2UI5_CL_POP_HTML`
14+
- `Z2UI5_CL_POP_INPUT_VAL`
15+
- `Z2UI5_CL_POP_ITAB_JSON_DL`
16+
- `Z2UI5_CL_POP_JS_LOADER`
17+
- `Z2UI5_CL_POP_MESSAGES`
18+
- `Z2UI5_CL_POP_PDF`
19+
- `Z2UI5_CL_POP_TABLE`
20+
- `Z2UI5_CL_POP_TEXTEDIT`
21+
- `Z2UI5_CL_POP_TO_CONFIRM`
22+
- `Z2UI5_CL_POP_TO_INFORM`
23+
- `Z2UI5_CL_POP_TO_SELECT`
24+
25+
Help expand this collection to cover more cases — contributions are welcome.

docs/development/popups/popover.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
outline: [2, 4]
3+
---
4+
# Popover
5+
6+
To show a popover, call `client->popover_display` and pass the ID of the control the popover should attach to:
7+
```abap
8+
METHOD z2ui5_if_app~main.
9+
10+
IF client->check_on_init( ).
11+
DATA(view) = z2ui5_cl_xml_view=>factory(
12+
)->shell(
13+
)->page( `Popover Example`
14+
)->button(
15+
text = `display popover`
16+
press = client->_event( `POPOVER_OPEN` )
17+
id = `TEST` ).
18+
client->view_display( view->stringify( ) ).
19+
20+
ENDIF.
21+
22+
CASE client->get( )-event.
23+
24+
WHEN `POPOVER_OPEN`.
25+
DATA(popover) = z2ui5_cl_xml_view=>factory_popup(
26+
)->popover( placement = `Left`
27+
)->text( `this is a popover`
28+
)->button(
29+
id = `my_id`
30+
text = `close`
31+
press = client->_event( `POPOVER_CLOSE` ) ).
32+
client->popover_display(
33+
xml = popover->stringify( )
34+
by_id = `TEST` ).
35+
36+
WHEN `POPOVER_CLOSE`.
37+
client->popover_destroy( ).
38+
ENDCASE.
39+
40+
ENDMETHOD.
41+
```
Lines changed: 5 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
---
22
outline: [2, 4]
33
---
4-
# Popups, Popovers
4+
# Popups
55

6-
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.
77

8-
### Popup
9-
10-
#### General
8+
## General
119

1210
To show a popup, call `client->popup_display` instead of `client->view_display`:
1311
```abap
@@ -21,7 +19,7 @@ To show a popup, call `client->popup_display` instead of `client->view_display`:
2119
ENDMETHOD.
2220
```
2321

24-
#### Flow Logic
22+
## Flow Logic
2523
A typical popup flow shows a normal view, opens a popup, and finally closes it. Structure it like this:
2624
```abap
2725
METHOD z2ui5_if_app~main.
@@ -55,7 +53,7 @@ A typical popup flow shows a normal view, opens a popup, and finally closes it.
5553
ENDMETHOD.
5654
```
5755

58-
#### Separated App
56+
## Separated App
5957
For a cleaner source layout, encapsulate popups in separate classes and call them via [navigation](/development/navigation/navigation).
6058

6159
An example with the confirmation popup:
@@ -83,63 +81,3 @@ An example with the confirmation popup:
8381
```
8482

8583
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

Comments
 (0)