Skip to content

Commit 847b4fb

Browse files
authored
update
1 parent 11bbe26 commit 847b4fb

File tree

1 file changed

+44
-4
lines changed

1 file changed

+44
-4
lines changed

docs/development/navigation.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,51 @@ outline: [2, 4]
33
---
44
# Navigation
55

6-
### Backend
6+
In abap2UI5, each application is represented by a single ABAP class. While you can embed all logic within a single class and call different views or popups within it, it is generally better practice to keep individual classes manageable in size. This can be achieved by creating multiple classes that interact with each other, allowing you to build reusable, generic applications and popups that can be called in various contexts.
77

8+
### Backend
9+
To call an ABAP class, use the following code:
10+
```abap
11+
METHOD z2ui5_if_app~main. root app
12+
DATA(lo_app) = NEW z2ui5_cl_demo_app_025( ).
13+
client->nav_app_call( lo_app ).
14+
ENDMETHOD.
15+
```
16+
The framework maintains a call stack. In the newly called class, you can return to the previous application using:
17+
```abap called app
18+
METHOD z2ui5_if_app~main.
19+
client->nav_app_leave( ).
20+
ENDMETHOD.
21+
```
22+
If you need to access data from the previous application, use casting as follows:
23+
```abap root app
24+
METHOD z2ui5_if_app~main.
25+
IF client->check_on_navigated( ).
26+
DATA(lo_called_app) = CAST z2ui5_cl_demo_app_025( client->get_app_prev( ) ).
27+
client->message_box_display( `Input made in the previous app:` && lo_called_app->mv_input ).
28+
ENDIF.
29+
ENDMETHOD.
30+
```
31+
To navigate to an application without adding it to the call stack, use:
32+
```abap
33+
METHOD z2ui5_if_app~main. root app
34+
DATA(lo_app) = NEW z2ui5_cl_demo_app_025( ).
35+
client->nav_app_call( lo_app ).
36+
ENDMETHOD.
37+
```
38+
::: tipp
39+
Sound familiar? The abap2UI5 framework is designed to emulate the classic “call screen” and “leave to screen” logic.
40+
:::
841

942
### Launchpad
10-
11-
43+
It is recommended to use backend communication exclusively for view changes or popup calls. If you’re using a launchpad, consider navigating through the launchpad to utilize browser navigation and history. Here’s an example:
44+
```abap
45+
client->_event_client(
46+
val = client->cs_event-cross_app_nav_to_ext
47+
t_arg = VALUE #( (
48+
`{ semanticObject: "Z2UI5_CL_LP_SAMPLE_04", action: "display" }`
49+
) ) ).
50+
```
51+
To learn more about launchpads and routing, refer to the documentation (here.)[configuration/launchpad]
1252
### Frontend
13-
In app
53+
Further frontend navigation features, including back button support with routing, are currently a work in progress. Track updates (here.)[https://github.com/abap2UI5/abap2UI5/issues/1420]

0 commit comments

Comments
 (0)