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
Copy file name to clipboardExpand all lines: docs/get_started/about.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,3 @@ Contributions are always welcome. Whether you fix bugs, build features, or impro
118
118
Volunteers maintain abap2UI5. If you or your company benefits from the project, please consider sponsoring it.
119
119
120
120
→ *Read more about [sponsorship opportunities](/resources/sponsor)*
121
-
122
-
### About This Documentation
123
-
124
-
This site explains the mental model, lifecycle, and recurring patterns of abap2UI5 — the *how* and *why* behind the framework. For the API surface (interfaces like `z2ui5_if_client`, helpers like `z2ui5_cl_xml_view`), read the source directly in the [main repository](https://github.com/abap2UI5/abap2UI5). For ready-to-copy code, browse the 250+ apps in the [samples repository](https://github.com/abap2UI5/samples). Treat this site as the index, not the catalog.
Copy file name to clipboardExpand all lines: docs/get_started/hello_world.md
+43-43Lines changed: 43 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,26 +3,8 @@ outline: [2, 4]
3
3
---
4
4
# Hello World
5
5
6
-
abap2UI5 follows a thin-frontend model: the browser only renders UI5 views, while all logic, state, and data handling stay in ABAP on the server. Three ideas to keep in mind before writing code:
7
-
8
-
-**One method, many calls.** The framework calls your app's `main` method on every roundtrip — on the initial start *and* after every user interaction (button press, input change, navigation).
9
-
-**State lives in your class.** Public attributes of your app class hold data between roundtrips; abap2UI5 serializes and restores them for you, so you don't manage sessions manually.
10
-
-**The `client` object is your only API.** Use it to display views, check which event fired, bind attributes to UI5 controls, and trigger navigation.
11
-
12
-
Every abap2UI5 app implements the `z2ui5_if_app` interface. It has a single method, `main`, with one parameter: `client` of type `z2ui5_if_client`:
13
-
```abap
14
-
INTERFACE z2ui5_if_app PUBLIC.
15
-
METHODS main
16
-
IMPORTING
17
-
client TYPE REF TO z2ui5_if_client.
18
-
ENDINTERFACE.
19
-
```
20
-
The `client` object is your only entry point into the framework. Use it to show views, handle events, share data, and navigate between apps.
21
-
22
-
→ *For a deeper look at the lifecycle and framework internals, see [How It All Works](/technical/how_it_all_works) and [Concept](/technical/concept).*
6
+
Just copy the following class into your system:
23
7
24
-
### Basic Example
25
-
Build a class:
26
8
```abap
27
9
CLASS zcl_app_hello_world DEFINITION PUBLIC.
28
10
PUBLIC SECTION.
@@ -31,9 +13,7 @@ ENDCLASS.
31
13
32
14
CLASS zcl_app_hello_world IMPLEMENTATION.
33
15
METHOD z2ui5_if_app~main.
34
-
35
16
client->message_box_display( `Hello World` ).
36
-
37
17
ENDMETHOD.
38
18
ENDCLASS.
39
19
```
@@ -63,28 +43,28 @@ CLASS zcl_app_hello_world IMPLEMENTATION.
63
43
ENDCLASS.
64
44
```
65
45
66
-
### Event Handler
67
-
The framework calls the `main` method on every roundtrip — on initialization and after every user interaction (button press, input submit, etc.):
46
+
### Info
47
+
abap2UI5 follows a thin-frontend model: the browser only renders UI5 views, while all logic, state, and data handling stay in ABAP on the server. Three ideas to keep in mind before writing code:
68
48
69
-
```text
70
-
┌─────────┐ ┌──────────┐ ┌─────────┐
71
-
│ Browser │──────>│ main() │──────>│ Browser │
72
-
│ (Start) │ HTTP │ init │ HTTP │ (View) │
73
-
└─────────┘ └──────────┘ └────┬─────┘
74
-
│ user clicks
75
-
┌─────────┐ ┌──────────┐ ┌────┴─────┐
76
-
│ Browser │<──────│ main() │<──────│ Browser │
77
-
│ (Update) │ HTTP │ event │ HTTP │ (Event) │
78
-
└─────────┘ └──────────┘ └──────────┘
49
+
-**One method, many calls.** The framework calls your app's `main` method on every roundtrip — on the initial start *and* after every user interaction (button press, input change, navigation).
50
+
-**State lives in your class.** Public attributes of your app class hold data between roundtrips; abap2UI5 serializes and restores them for you, so you don't manage sessions manually.
51
+
-**The `client` object is your only API.** Use it to display views, check which event fired, bind attributes to UI5 controls, and trigger navigation.
52
+
53
+
Every abap2UI5 app implements the `z2ui5_if_app` interface. It has a single method, `main`, with one parameter: `client` of type `z2ui5_if_client`:
54
+
```abap
55
+
INTERFACE z2ui5_if_app PUBLIC.
56
+
METHODS main
57
+
IMPORTING
58
+
client TYPE REF TO z2ui5_if_client.
59
+
ENDINTERFACE.
79
60
```
61
+
The `client` object is your only entry point into the framework. Use it to show views, handle events, share data, and navigate between apps.
80
62
81
-
To distinguish between lifecycle events, use `CASE abap_true`:
63
+
→ *For a deeper look at the lifecycle and framework internals, see [How It All Works](/technical/how_it_all_works) and [Concept](/technical/concept).*
82
64
83
-
-`client->check_on_init( )` — first call when the app starts
84
-
-`client->check_on_event( )` — user triggered an event (e.g., button press)
85
-
-`client->check_on_navigated( )` — returned from another app via navigation
65
+
### Events
86
66
87
-
Each `check_*` method returns `abap_true` only for its specific phase, so `CASE abap_true` acts as a dispatcher:
67
+
Let's extend the code with some event handling:
88
68
```abap
89
69
CLASS zcl_app_hello_world DEFINITION PUBLIC.
90
70
PUBLIC SECTION.
@@ -94,26 +74,46 @@ ENDCLASS.
94
74
CLASS zcl_app_hello_world IMPLEMENTATION.
95
75
METHOD z2ui5_if_app~main.
96
76
97
-
CASE abap_true.
98
-
99
-
WHEN client->check_on_init( ).
77
+
IF client->check_on_init( ).
100
78
101
79
DATA(view) = z2ui5_cl_xml_view=>factory(
102
80
)->page( `abap2UI5 - Hello World`
103
81
)->text( `My Text`
104
82
)->button( text = `post` press = client->_event( `POST` ) ).
105
83
client->view_display( view->stringify( ) ).
106
84
107
-
WHEN client->check_on_event( `POST` ).
85
+
ELSEIF client->check_on_event( `POST` ).
108
86
109
87
client->message_box_display( `Hello World!` ).
110
88
111
-
ENDCASE.
89
+
ENDIF.
112
90
113
91
ENDMETHOD.
114
92
ENDCLASS.
115
93
```
116
94
95
+
### Info
96
+
The framework calls the `main` method on every roundtrip — on initialization and after every user interaction (button press, input submit, etc.):
97
+
98
+
```text
99
+
┌─────────┐ ┌──────────┐ ┌─────────┐
100
+
│ Browser │──────>│ main() │──────>│ Browser │
101
+
│ (Start) │ HTTP │ init │ HTTP │ (View) │
102
+
└─────────┘ └──────────┘ └────┬─────┘
103
+
│ user clicks
104
+
┌─────────┐ ┌──────────┐ ┌────┴─────┐
105
+
│ Browser │<──────│ main() │<──────│ Browser │
106
+
│ (Update) │ HTTP │ event │ HTTP │ (Event) │
107
+
└─────────┘ └──────────┘ └──────────┘
108
+
```
109
+
110
+
To distinguish between lifecycle events, check for the following events:
111
+
112
+
-`client->check_on_init( )` — first call when the app starts
113
+
-`client->check_on_event( )` — user triggered an event (e.g., button press)
114
+
115
+
Each `check_*` method returns `abap_true` only for its specific phase, so is acts as a dispatcher:
116
+
117
117
### Data Flow
118
118
Finally, add a public attribute to send data to the backend:
0 commit comments