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
)->text( `this is an information shown in a popup` ).
19
19
client->popup_display( lo_popup->stringify( ) ).
20
20
21
-
ENDMETHOD.
21
+
ENDMETHOD.
22
22
```
23
23
24
24
#### Flow Logic
25
25
A common flow for using popups typically involves displaying a normal view, then showing a popup, and finally closing it. Here’s how to structure this:
For better source code structure, you can encapsulate popups in separate classes and call them through [navigation](/development/navigation/navigation).
60
60
61
61
Check out the popup to confirm, for example:
62
62
```abap
63
-
METHOD z2ui5_if_app~main.
63
+
METHOD z2ui5_if_app~main.
64
64
65
-
IF client->check_on_init( ).
66
-
client->nav_app_call( z2ui5_cl_pop_to_confirm=>factory( `Can you confirm this?` ) ).
67
-
ENDIF.
65
+
IF client->check_on_init( ).
66
+
client->nav_app_call( z2ui5_cl_pop_to_confirm=>factory( `Can you confirm this?` ) ).
67
+
ENDIF.
68
68
69
-
CASE client->get( )-event.
70
-
WHEN z2ui5_cl_pop_to_confirm=>cs_event-confirmed.
71
-
client->message_box_display( `the result is confirmed` ).
72
-
WHEN z2ui5_cl_pop_to_confirm=>cs_event-canceled.
73
-
client->message_box_display( `the result is rejected` ).
74
-
ENDCASE.
69
+
CASE client->get( )-event.
70
+
WHEN z2ui5_cl_pop_to_confirm=>cs_event-confirmed.
71
+
client->message_box_display( `the result is confirmed` ).
72
+
WHEN z2ui5_cl_pop_to_confirm=>cs_event-canceled.
73
+
client->message_box_display( `the result is rejected` ).
74
+
ENDCASE.
75
75
76
-
ENDMETHOD.
76
+
ENDMETHOD.
77
77
```
78
78
79
79
If you need to manage a stack of multiple popups, remember that abap2UI5 displays only one popup at a time on the frontend. However, you can maintain a popup stack in your backend logic and re-display the previous popup as needed. Check out `Z2UI5_CL_DEMO_APP_161`.
80
80
81
81
### Popover
82
82
To display a popover, use the method `client->popover_display` and specify the ID of the control where you want the popover to appear:
In ABAP Cloud, you can directly pass the logging object into the popup:
24
24
```abap
25
-
METHOD z2ui5_if_app~main.
25
+
METHOD z2ui5_if_app~main.
26
26
27
27
DATA(lo_log) = cl_bali_log=>create( ).
28
28
DATA(lo_msg) = cl_bali_message_setter=>create(
@@ -48,7 +48,7 @@ ENDMETHOD.
48
48
##### abap-logger
49
49
You also have the option to use the fantastic open-source project [**abap-logger**](https://github.com/ABAP-Logger/ABAP-Logger). This tool simplifies working with BAL logs and integrates seamlessly with abap2UI5. Here’s an example:
Compared to message classes, BAL logs include more detailed information, such as timestamps. Use the specific BAL log popup to display this information. All the examples above can be used with the `z2ui5_cl_pop_bal` popup for a more detailed output, here’s an example for the abap-logger:
0 commit comments