Skip to content

Commit 8de3f97

Browse files
authored
Merge branch 'main' into claude/fix-string-delimiters-01PgDBDWnGZWUMAJgeUbnmbi
2 parents a8baeba + 8e7bdd2 commit 8de3f97

File tree

5 files changed

+66
-65
lines changed

5 files changed

+66
-65
lines changed

docs/development/general.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,28 @@ CLASS z2ui5_cl_app IMPLEMENTATION.
1414
METHOD z2ui5_if_app~main.
1515
TRY.
1616
17-
"first app start
18-
IF client->check_on_init( ).
19-
"init values
20-
"display view
21-
RETURN.
22-
ENDIF.
23-
24-
"callback after navigation
25-
IF client->check_on_navigated( ).
26-
DATA(lo_app_prev) = client->get_app_prev( ).
27-
"read attributes of previous app
28-
"do something
29-
RETURN.
30-
ENDIF.
31-
32-
"handle events after frontend
33-
CASE client->get( )-event.
34-
WHEN `OK`.
35-
DATA(lt_arg) = client->get_event_arg( ).
36-
"event handling
37-
WHEN `CANCEL`.
17+
CASE abap_true.
18+
19+
WHEN client->check_on_init( ).
3820
"...
21+
22+
WHEN client->check_on_navigated( ).
23+
DATA(lo_app_prev) = client->get_app_prev( ).
24+
"...
25+
26+
WHEN client->check_on_event( ).
27+
DATA(lt_arg) = client->get_event_arg( ).
28+
29+
CASE abap_true.
30+
WHEN client->check_on_event( `OK` ).
31+
"...
32+
33+
WHEN client->check_on_event( `CANCEL` ).
34+
"...
35+
36+
ENDCASE.
3937
ENDCASE.
4038
41-
"error handling
4239
CATCH cx_root INTO DATA(lx).
4340
client->message_box_display( lx ).
4441
ENDTRY.

docs/development/model/fuzzy.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/development/navigation/share.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The app state feature leads to various additional use cases.
44

55
### Share
6-
You can easily intgerate a share button, which copies the actiual state into the clpiboard for sharing with your collegues. Check out the followig snippet:
6+
You can easily integrate a share button, which copies the actiual state into the clpiboard for sharing with your collegues. Check out the followig snippet:
77
```abap
88
CLASS z2ui5_cl_sample_share DEFINITION PUBLIC FINAL CREATE PUBLIC.
99
@@ -15,20 +15,19 @@ ENDCLASS.
1515
1616
CLASS z2ui5_cl_sample_share IMPLEMENTATION.
1717
METHOD z2ui5_if_app~main.
18-
19-
IF client->check_on_navigated( ).
20-
DATA(view) = z2ui5_cl_xml_view=>factory( ).
21-
client->view_display( view->shell(
22-
)->label( `quantity`
23-
)->input( client->_bind_edit( mv_quantity )
24-
)->button(
25-
text = `share`
26-
press = client->_event( `BUTTON_POST` )
27-
)->stringify( ) ).
28-
ENDIF.
29-
30-
CASE client->get( )-event.
31-
WHEN `BUTTON_POST`.
18+
19+
CASE abap_true.
20+
21+
WHEN client->check_on_navigated( ).
22+
23+
DATA(view) = z2ui5_cl_xml_view=>factory( )->shell( )->page(
24+
)->label( `quantity`
25+
)->input( client->_bind_edit( mv_quantity )
26+
)->button( text = `share` press = client->_event( `BUTTON_POST` ) ).
27+
client->view_display( view->stringify( ) ).
28+
29+
WHEN client->check_on_event( `BUTTON_POST` ).
30+
3231
client->follow_up_action( client->_event_client( z2ui5_if_client=>cs_event-CLIPBOARD_APP_STATE ) ).
3332
client->message_toast_display( `clipboard copied` ).
3433

docs/get_started/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENDCLASS.
1515
1616
CLASS zcl_my_app IMPLEMENTATION.
1717
METHOD z2ui5_if_app~main.
18-
client->message_box_display( |Hello World| ).
18+
client->message_box_display( `Hello World` ).
1919
ENDMETHOD.
2020
ENDCLASS.
2121
```

docs/get_started/hello_world.md

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ENDCLASS.
1616
CLASS zcl_app_hello_world IMPLEMENTATION.
1717
METHOD z2ui5_if_app~main.
1818
19-
client->message_box_display( |Hello World| ).
19+
client->message_box_display( `Hello World` ).
2020
2121
ENDMETHOD.
2222
ENDCLASS.
@@ -27,46 +27,47 @@ Head back to the landing page in your browser and enter `Z2UI5_CL_APP_HELLO_WORL
2727
Now, let's add our first view to display a simple text:
2828
```abap
2929
CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC.
30-
3130
PUBLIC SECTION.
3231
INTERFACES z2ui5_if_app.
33-
3432
ENDCLASS.
3533
3634
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
3735
METHOD z2ui5_if_app~main.
3836
39-
client->view_display( z2ui5_cl_xml_view=>factory(
40-
)->page( |abap2UI5 - Hello World|
41-
)->text( |My Text| ) ).
37+
DATA(view) = z2ui5_cl_xml_view=>factory(
38+
)->page( `abap2UI5 - Hello World`
39+
)->text( `My Text` ).
40+
client->view_display( view->stringify( ) ).
4241
4342
ENDMETHOD.
4443
ENDCLASS.
4544
```
4645

4746
### Event Handler
48-
Next, we extend the app with a button and an event:
47+
Next, we extend the app with a button and an event handler. To ensure that the view is only rendered at the start, we also check for the `on_init` event:
4948
```abap
5049
CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC.
51-
5250
PUBLIC SECTION.
5351
INTERFACES z2ui5_if_app.
54-
DATA name TYPE string.
55-
5652
ENDCLASS.
5753
5854
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
5955
METHOD z2ui5_if_app~main.
6056
61-
client->view_display( z2ui5_cl_xml_view=>factory(
62-
)->page( `abap2UI5 - Hello World`
57+
CASE abap_true.
58+
59+
WHEN client->check_on_init( ).
60+
61+
DATA(view) = z2ui5_cl_xml_view=>factory(
62+
)->page( `abap2UI5 - Hello World`
6363
)->text( `My Text`
64-
)->button( text = `post` press = client->_event( `POST` ) ) ).
64+
)->button( text = `post` press = client->_event( `POST` ) ).
65+
client->view_display( view->stringify( ) ).
66+
67+
WHEN client->check_on_event( `POST` ).
6568
66-
CASE client->get( )-event.
67-
WHEN `POST`.
6869
client->message_box_display( `Hello World!` ).
69-
RETURN.
70+
7071
ENDCASE.
7172
7273
ENDMETHOD.
@@ -77,26 +78,31 @@ ENDCLASS.
7778
Finally, we add a public attribute and can send data to the backend:
7879
```abap
7980
CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC.
80-
8181
PUBLIC SECTION.
8282
INTERFACES z2ui5_if_app.
8383
DATA name TYPE string.
84-
8584
ENDCLASS.
8685
8786
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
8887
METHOD z2ui5_if_app~main.
8988
90-
client->view_display( z2ui5_cl_xml_view=>factory(
91-
)->page( `abap2UI5 - Hello World`
92-
)->text( `My Text`
93-
)->button( text = `post` press = client->_event( `POST` )
94-
)->input( client->_bind_edit( name ) ) ).
89+
CASE abap_true.
90+
91+
WHEN client->check_on_init( ).
92+
93+
DATA(view) = z2ui5_cl_xml_view=>factory(
94+
)->page( `abap2UI5 - Hello World`
95+
)->text( `My Text`
96+
)->button(
97+
text = `post`
98+
press = client->_event( `POST` )
99+
)->input( client->_bind_edit( name ) ).
100+
client->view_display( view->stringify( ) ).
101+
102+
WHEN client->check_on_event( `POST` ).
95103
96-
CASE client->get( )-event.
97-
WHEN `POST`.
98104
client->message_box_display( |Your name is { name }.| ).
99-
RETURN.
105+
100106
ENDCASE.
101107
102108
ENDMETHOD.

0 commit comments

Comments
 (0)