Skip to content

Commit ef0d453

Browse files
committed
Move Navigation page content into Inner/Cross App subpage
1 parent 281c59c commit ef0d453

3 files changed

Lines changed: 66 additions & 61 deletions

File tree

docs/.vitepress/config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export default defineConfig({
162162
link: "/development/navigation/navigation",
163163
collapsed: true,
164164
items: [
165+
{ text: "Inner/Cross App", link: "/development/navigation/inner_cross_app" },
165166
{ text: "App State", link: "/development/navigation/app_state" },
166167
{
167168
text: "Share, Bookmark",
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
outline: [2, 4]
3+
---
4+
# Inner/Cross App
5+
6+
In abap2UI5, each app is a single ABAP class. You can pack all logic into one class, but keeping classes at a reasonable size is better practice. Splitting functionality into multiple interacting classes lets you build reusable apps and popups that work in different contexts.
7+
8+
## Cross App Navigation
9+
10+
### Backend
11+
To call an ABAP class:
12+
```abap
13+
METHOD z2ui5_if_app~main.
14+
15+
DATA(lo_app) = NEW z2ui5_cl_new_app( ).
16+
client->nav_app_call( lo_app ).
17+
18+
ENDMETHOD.
19+
```
20+
The framework keeps a call stack. From the newly called class, return to the previous app with:
21+
```abap
22+
METHOD z2ui5_if_app~main.
23+
24+
client->nav_app_leave( ).
25+
26+
ENDMETHOD.
27+
```
28+
To read data from the previous app, cast it like this:
29+
```abap
30+
METHOD z2ui5_if_app~main.
31+
32+
IF client->check_on_navigated( ).
33+
DATA(lo_called_app) = CAST z2ui5_cl_new_app( client->get_app_prev( ) ).
34+
client->message_box_display( `Input made in the previous app:` && lo_called_app->mv_input ).
35+
ENDIF.
36+
37+
ENDMETHOD.
38+
```
39+
To navigate to an app without pushing it onto the call stack:
40+
```abap
41+
METHOD z2ui5_if_app~main.
42+
43+
DATA(lo_app) = NEW z2ui5_cl_new_app( ).
44+
client->nav_app_leave( lo_app ).
45+
46+
ENDMETHOD.
47+
```
48+
::: tip
49+
Sounds familiar? The abap2UI5 framework echoes classic `call screen` and `leave to screen` behavior.
50+
:::
51+
52+
### Launchpad
53+
We recommend backend communication only for view changes or popup calls. With a Launchpad, consider navigating via the Launchpad to use browser navigation and history:
54+
```abap
55+
client->_event_client(
56+
val = client->cs_event-cross_app_nav_to_ext
57+
t_arg = VALUE #( (
58+
`{ semanticObject: "Z2UI5_CL_LP_SAMPLE_04", action: "display" }`
59+
) ) ).
60+
```
61+
For more on Launchpads and routing, see the [Fiori Launchpad](/configuration/launchpad) page.
62+
63+
## Inner App Navigation
64+
65+
Use class attributes to track the current state and switch views as needed. This keeps navigation logic in a single ABAP class with no cross-app calls.

docs/development/navigation/navigation.md

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,3 @@
22
outline: [2, 4]
33
---
44
# Navigation
5-
6-
In abap2UI5, each app is a single ABAP class. You can pack all logic into one class, but keeping classes at a reasonable size is better practice. Splitting functionality into multiple interacting classes lets you build reusable apps and popups that work in different contexts.
7-
8-
### Cross App Navigation
9-
10-
#### Backend
11-
To call an ABAP class:
12-
```abap
13-
METHOD z2ui5_if_app~main.
14-
15-
DATA(lo_app) = NEW z2ui5_cl_new_app( ).
16-
client->nav_app_call( lo_app ).
17-
18-
ENDMETHOD.
19-
```
20-
The framework keeps a call stack. From the newly called class, return to the previous app with:
21-
```abap
22-
METHOD z2ui5_if_app~main.
23-
24-
client->nav_app_leave( ).
25-
26-
ENDMETHOD.
27-
```
28-
To read data from the previous app, cast it like this:
29-
```abap
30-
METHOD z2ui5_if_app~main.
31-
32-
IF client->check_on_navigated( ).
33-
DATA(lo_called_app) = CAST z2ui5_cl_new_app( client->get_app_prev( ) ).
34-
client->message_box_display( `Input made in the previous app:` && lo_called_app->mv_input ).
35-
ENDIF.
36-
37-
ENDMETHOD.
38-
```
39-
To navigate to an app without pushing it onto the call stack:
40-
```abap
41-
METHOD z2ui5_if_app~main.
42-
43-
DATA(lo_app) = NEW z2ui5_cl_new_app( ).
44-
client->nav_app_leave( lo_app ).
45-
46-
ENDMETHOD.
47-
```
48-
::: tip
49-
Sounds familiar? The abap2UI5 framework echoes classic `call screen` and `leave to screen` behavior.
50-
:::
51-
52-
#### Launchpad
53-
We recommend backend communication only for view changes or popup calls. With a Launchpad, consider navigating via the Launchpad to use browser navigation and history:
54-
```abap
55-
client->_event_client(
56-
val = client->cs_event-cross_app_nav_to_ext
57-
t_arg = VALUE #( (
58-
`{ semanticObject: "Z2UI5_CL_LP_SAMPLE_04", action: "display" }`
59-
) ) ).
60-
```
61-
For more on Launchpads and routing, see the [Fiori Launchpad](/configuration/launchpad) page.
62-
63-
### Inner App Navigation
64-
65-
Use class attributes to track the current state and switch views as needed. This keeps navigation logic in a single ABAP class with no cross-app calls.

0 commit comments

Comments
 (0)