Skip to content

Commit 376fe00

Browse files
committed
Docs: use follow_up_action( val, t_arg ) instead of eF strings
Follow the framework change that folds action->gen into follow_up_action: examples now pass the frontend event and arguments directly via follow_up_action( val = ... t_arg = ... ) rather than assembling an .eF( ) string by hand. follow_up_action.md documents both ways (event+args and raw JS); action.md stays the obsolete page and shows the plain rename as the migration. vitepress build passes (no dead links). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vTnxZtHiAd4tiqMvxFdgJ
1 parent 3f642af commit 376fe00

19 files changed

Lines changed: 158 additions & 64 deletions

File tree

docs/configuration/launchpad.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ ENDIF.
3434
Change the Launchpad shell title from ABAP at any time with the `set_title_launchpad` frontend event:
3535

3636
```abap
37-
client->follow_up_action( |.eF('SET_TITLE_LAUNCHPAD', 'My Dynamic Title')| ).
37+
client->follow_up_action(
38+
val = z2ui5_if_client=>cs_event-set_title_launchpad
39+
t_arg = VALUE #( ( `My Dynamic Title` ) ) ).
3840
```
3941

4042
#### Read Startup Parameters

docs/cookbook/browser_interaction/clipboard.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ CLASS z2ui5_cl_sample_clipboard IMPLEMENTATION.
3131
)->stringify( ) ).
3232
3333
WHEN client->check_on_event( `COPY` ).
34-
client->follow_up_action( |.eF('CLIPBOARD_COPY', '{ mv_text }')| ).
34+
client->follow_up_action(
35+
val = client->cs_event-clipboard_copy
36+
t_arg = VALUE #( ( mv_text ) ) ).
3537
client->message_toast_display( `copied` ).
3638
3739
ENDCASE.

docs/cookbook/browser_interaction/focus.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This is useful for guided data entry, barcode scanning, or any flow where the ne
2525

2626
#### Basic Usage
2727

28-
After processing an event, call `client->follow_up_action( )` with the `SET_FOCUS` frontend event and the id of the input to focus next. (The value bindings on the inputs are omitted here to keep the focus logic clear — see [Barcode Scanning](/cookbook/device_capabilities/barcode_scanning) for the same form with bound inputs.)
28+
After processing an event, call `client->follow_up_action( )` with `cs_event-set_focus` and the id of the input to focus next. (The value bindings on the inputs are omitted here to keep the focus logic clear — see [Barcode Scanning](/cookbook/device_capabilities/barcode_scanning) for the same form with bound inputs.)
2929

3030
```abap
3131
METHOD z2ui5_if_app~main.
@@ -45,10 +45,12 @@ METHOD z2ui5_if_app~main.
4545
client->view_display( page->stringify( ) ).
4646
4747
ELSEIF client->check_on_event( `ONE_ENTER` ).
48-
client->follow_up_action( |.eF('SET_FOCUS', 'id2')| ).
48+
client->follow_up_action( val = client->cs_event-set_focus
49+
t_arg = VALUE #( ( `id2` ) ) ).
4950
5051
ELSEIF client->check_on_event( `TWO_ENTER` ).
51-
client->follow_up_action( |.eF('SET_FOCUS', 'id1')| ).
52+
client->follow_up_action( val = client->cs_event-set_focus
53+
t_arg = VALUE #( ( `id1` ) ) ).
5254
5355
ENDIF.
5456
@@ -62,7 +64,8 @@ After the user presses Enter in `id1`, the backend fires `set_focus` for `id2` a
6264
To position the caret inside the field or pre-select a range, pass the start and end offsets as additional arguments:
6365

6466
```abap
65-
client->follow_up_action( |.eF('SET_FOCUS', 'id1', '0', '5')| ).
67+
client->follow_up_action( val = client->cs_event-set_focus
68+
t_arg = VALUE #( ( `id1` ) ( `0` ) ( `5` ) ) ).
6669
```
6770

6871
#### Barcode Scanning

docs/cookbook/browser_interaction/scrolling.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ CLASS z2ui5_cl_sample_scrolling IMPLEMENTATION.
5252
5353
CASE client->get( )-event.
5454
WHEN `SCROLL_TOP`.
55-
client->follow_up_action( |.eF('SCROLL_TO', 'id_page', '0')| ).
55+
client->follow_up_action( val = client->cs_event-scroll_to
56+
t_arg = VALUE #( ( `id_page` ) ( `0` ) ) ).
5657
WHEN `SCROLL_BOTTOM`.
57-
client->follow_up_action( |.eF('SCROLL_TO', 'id_page', '99999')| ).
58+
client->follow_up_action( val = client->cs_event-scroll_to
59+
t_arg = VALUE #( ( `id_page` ) ( `99999` ) ) ).
5860
ENDCASE.
5961
6062
ENDMETHOD.
@@ -64,19 +66,22 @@ ENDCLASS.
6466
The arguments for `scroll_to` are `id`, `scrollTop` (y, px), `scrollLeft` (x, px, optional), and `behavior` (optional):
6567

6668
```abap
67-
client->follow_up_action( |.eF('SCROLL_TO', 'id_page', '500', '0', 'smooth')| ).
69+
client->follow_up_action( val = client->cs_event-scroll_to
70+
t_arg = VALUE #( ( `id_page` ) ( `500` ) ( `0` ) ( `smooth` ) ) ).
6871
```
6972

7073
#### Scroll an Element into View
7174

7275
To reveal a specific control — e.g. a row after a search — use `scroll_into_view` with the target control's id:
7376

7477
```abap
75-
client->follow_up_action( |.eF('SCROLL_INTO_VIEW', 'id_row_42')| ).
78+
client->follow_up_action( val = client->cs_event-scroll_into_view
79+
t_arg = VALUE #( ( `id_row_42` ) ) ).
7680
```
7781

7882
Additional optional arguments mirror the browser's `scrollIntoView` options: `behavior` (`smooth` | `auto` | `instant`), `block` (`start` | `center` | `end` | `nearest`), `inline` (`nearest` | `start` | `center` | `end`):
7983

8084
```abap
81-
client->follow_up_action( |.eF('SCROLL_INTO_VIEW', 'id_row_42', 'smooth', 'center')| ).
85+
client->follow_up_action( val = client->cs_event-scroll_into_view
86+
t_arg = VALUE #( ( `id_row_42` ) ( `smooth` ) ( `center` ) ) ).
8287
```

docs/cookbook/browser_interaction/soft_keyboard.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ METHOD z2ui5_if_app~main.
3636
3737
CASE client->get( )-event.
3838
WHEN `CALL_KEYBOARD`.
39-
client->follow_up_action( |.eF('KEYBOARD_SET_MODE', 'ZINPUT', 'none')| ).
39+
client->follow_up_action( val = client->cs_event-keyboard_set_mode
40+
t_arg = VALUE #( ( `ZINPUT` ) ( `none` ) ) ).
4041
WHEN `BACK`.
4142
client->nav_app_leave( ).
4243
ENDCASE.

docs/cookbook/browser_interaction/timer.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Fire a backend event after a delay with the `start_timer` frontend event. Handy
88
Pass the event name to fire and the delay in milliseconds:
99

1010
```abap
11-
client->follow_up_action( |.eF('START_TIMER', 'REFRESH', '2000')| ).
11+
client->follow_up_action(
12+
val = client->cs_event-start_timer
13+
t_arg = VALUE #( ( `REFRESH` ) ( `2000` ) ) ).
1214
```
1315

1416
After 2 seconds the browser triggers a backend roundtrip with the event name `REFRESH`, which you handle via `check_on_event` like any other event.
@@ -36,12 +38,14 @@ CLASS z2ui5_cl_sample_timer IMPLEMENTATION.
3638
)->page( `abap2UI5 - Timer`
3739
)->text( client->_bind( counter )
3840
)->stringify( ) ).
39-
client->follow_up_action( |.eF('START_TIMER', 'TICK', '2000')| ).
41+
client->follow_up_action( val = client->cs_event-start_timer
42+
t_arg = VALUE #( ( `TICK` ) ( `2000` ) ) ).
4043
4144
WHEN client->check_on_event( `TICK` ).
4245
counter = counter + 1.
4346
client->view_model_update( ).
44-
client->follow_up_action( |.eF('START_TIMER', 'TICK', '2000')| ).
47+
client->follow_up_action( val = client->cs_event-start_timer
48+
t_arg = VALUE #( ( `TICK` ) ( `2000` ) ) ).
4549
4650
ENDCASE.
4751
@@ -57,10 +61,12 @@ A single `start_timer` call fires once — perfect for a deferred action like op
5761

5862
```abap
5963
WHEN client->check_on_event( `BUTTON_OPEN_NEW_TAB` ).
60-
client->follow_up_action( |.eF('START_TIMER', 'FIRE_OPEN_TAB', '500')| ).
64+
client->follow_up_action( val = client->cs_event-start_timer
65+
t_arg = VALUE #( ( `FIRE_OPEN_TAB` ) ( `500` ) ) ).
6166
6267
WHEN client->check_on_event( `FIRE_OPEN_TAB` ).
63-
client->follow_up_action( |.eF('OPEN_NEW_TAB', 'https://www.google.com/search?q=abap2ui5')| ).
68+
client->follow_up_action( val = client->cs_event-open_new_tab
69+
t_arg = VALUE #( ( `https://www.google.com/search?q=abap2ui5` ) ) ).
6470
```
6571

6672
#### Replacing a Pending Timer

docs/cookbook/browser_interaction/title.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ METHOD z2ui5_if_app~main.
2323
)->stringify( ) ).
2424
2525
WHEN client->check_on_event( `RENAME` ).
26-
client->follow_up_action( |.eF('SET_TITLE', 'Invoice 4711')| ).
26+
client->follow_up_action(
27+
val = client->cs_event-set_title
28+
t_arg = VALUE #( ( `Invoice 4711` ) ) ).
2729
2830
ENDCASE.
2931
@@ -35,7 +37,9 @@ METHOD z2ui5_if_app~main.
3537
When the app runs inside an SAP Fiori Launchpad shell, use the dedicated `set_title_launchpad` event instead. It forwards the title to the shell's `ShellUIService` rather than setting `document.title`:
3638

3739
```abap
38-
client->follow_up_action( |.eF('SET_TITLE_LAUNCHPAD', 'Invoice 4711')| ).
40+
client->follow_up_action(
41+
val = client->cs_event-set_title_launchpad
42+
t_arg = VALUE #( ( `Invoice 4711` ) ) ).
3943
```
4044

4145
Use `set_title` for the browser tab/window title (standalone) and `set_title_launchpad` for the launchpad shell title.

docs/cookbook/browser_interaction/url_handling.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ DATA(lv_search) = client->get( )-s_config-search.
1616
Open a URL in a new browser tab via a frontend event:
1717
```abap
1818
DATA(lv_url) = `https://www.abap2UI5.org`.
19-
client->follow_up_action( |.eF('OPEN_NEW_TAB', '{ lv_url }')| ).
19+
client->follow_up_action(
20+
val = client->cs_event-open_new_tab
21+
t_arg = VALUE #( ( lv_url ) ) ).
2022
```
2123

2224
#### Browser History

docs/cookbook/device_capabilities/audio.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ CLASS z2ui5_cl_sample_sound IMPLEMENTATION.
3939
4040
IF client->get( )-event = `CHECK_INPUT`.
4141
IF company_code IS INITIAL.
42-
client->follow_up_action( |.eF('PLAY_AUDIO', '/SAP/PUBLIC/BC/ABAP/mime_demo/bam.wav')| ).
42+
client->follow_up_action( val = client->cs_event-play_audio
43+
t_arg = VALUE #( ( `/SAP/PUBLIC/BC/ABAP/mime_demo/bam.wav` ) ) ).
4344
client->message_box_display( type = `error` text = `Input is empty!` ).
4445
ELSE.
4546
CLEAR company_code.

docs/cookbook/device_capabilities/barcode_scanning.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ CLASS z2ui5_cl_sample_focus IMPLEMENTATION.
8686
8787
CASE client->get( )-event.
8888
WHEN `ONE_ENTER`.
89-
client->follow_up_action( |.eF('SET_FOCUS', 'id2')| ).
89+
client->follow_up_action( val = client->cs_event-set_focus
90+
t_arg = VALUE #( ( `id2` ) ) ).
9091
WHEN `TWO_ENTER`.
91-
client->follow_up_action( |.eF('SET_FOCUS', 'id1')| ).
92+
client->follow_up_action( val = client->cs_event-set_focus
93+
t_arg = VALUE #( ( `id1` ) ) ).
9294
ENDCASE.
9395
9496
ENDMETHOD.
@@ -129,7 +131,8 @@ CLASS z2ui5_cl_sample_sound IMPLEMENTATION.
129131
130132
IF client->get( )-event = `CHECK_INPUT`.
131133
IF company_code IS INITIAL.
132-
client->follow_up_action( |.eF('PLAY_AUDIO', '/SAP/PUBLIC/BC/ABAP/mime_demo/bam.wav')| ).
134+
client->follow_up_action( val = client->cs_event-play_audio
135+
t_arg = VALUE #( ( `/SAP/PUBLIC/BC/ABAP/mime_demo/bam.wav` ) ) ).
133136
client->message_box_display( type = `error` text = `Input is empty!` ).
134137
ELSE.
135138
CLEAR company_code.

0 commit comments

Comments
 (0)