Skip to content

Commit 187bd39

Browse files
committed
docs: update action calls to client->action->gen( )
Reflect the new z2ui5_if_action interface in the cookbook: the client `action` method is now an `action` interface reference whose `gen( )` method carries the same signature. All examples and prose now use `client->action->gen( )`. https://claude.ai/code/session_0123tcSwjTWxoGTG6YossyaN
1 parent 31504ae commit 187bd39

20 files changed

Lines changed: 49 additions & 49 deletions

docs/cookbook/browser_interaction/clipboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CLASS z2ui5_cl_sample_clipboard IMPLEMENTATION.
3131
)->stringify( ) ).
3232
3333
WHEN client->check_on_event( `COPY` ).
34-
client->action(
34+
client->action->gen(
3535
val = client->cs_event-clipboard_copy
3636
t_arg = VALUE #( ( mv_text ) ) ).
3737
client->message_toast_display( `copied` ).

docs/cookbook/browser_interaction/focus.md

Lines changed: 4 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->action( )` with `cs_event-set_focus` and the id of the input to focus next:
28+
After processing an event, call `client->action->gen( )` with `cs_event-set_focus` and the id of the input to focus next:
2929

3030
```abap
3131
METHOD z2ui5_if_app~main.
@@ -45,11 +45,11 @@ METHOD z2ui5_if_app~main.
4545
client->view_display( page->stringify( ) ).
4646
4747
ELSEIF client->check_on_event( `ONE_ENTER` ).
48-
client->action( val = client->cs_event-set_focus
48+
client->action->gen( val = client->cs_event-set_focus
4949
t_arg = VALUE #( ( `id2` ) ) ).
5050
5151
ELSEIF client->check_on_event( `TWO_ENTER` ).
52-
client->action( val = client->cs_event-set_focus
52+
client->action->gen( val = client->cs_event-set_focus
5353
t_arg = VALUE #( ( `id1` ) ) ).
5454
5555
ENDIF.
@@ -64,7 +64,7 @@ After the user presses Enter in `id1`, the backend fires `set_focus` for `id2` a
6464
To position the caret inside the field or pre-select a range, pass the start and end offsets as additional arguments:
6565

6666
```abap
67-
client->action( val = client->cs_event-set_focus
67+
client->action->gen( val = client->cs_event-set_focus
6868
t_arg = VALUE #( ( `id1` ) ( `0` ) ( `5` ) ) ).
6969
```
7070

docs/cookbook/browser_interaction/scrolling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ CLASS z2ui5_cl_sample_scrolling IMPLEMENTATION.
5252
5353
CASE client->get( )-event.
5454
WHEN `SCROLL_TOP`.
55-
client->action( val = client->cs_event-scroll_to
55+
client->action->gen( val = client->cs_event-scroll_to
5656
t_arg = VALUE #( ( `id_page` ) ( `0` ) ) ).
5757
WHEN `SCROLL_BOTTOM`.
58-
client->action( val = client->cs_event-scroll_to
58+
client->action->gen( val = client->cs_event-scroll_to
5959
t_arg = VALUE #( ( `id_page` ) ( `99999` ) ) ).
6060
ENDCASE.
6161
@@ -66,7 +66,7 @@ ENDCLASS.
6666
The arguments for `scroll_to` are `id`, `scrollTop` (y, px), `scrollLeft` (x, px, optional), and `behavior` (optional):
6767

6868
```abap
69-
client->action( val = client->cs_event-scroll_to
69+
client->action->gen( val = client->cs_event-scroll_to
7070
t_arg = VALUE #( ( `id_page` ) ( `500` ) ( `0` ) ( `smooth` ) ) ).
7171
```
7272

@@ -75,13 +75,13 @@ client->action( val = client->cs_event-scroll_to
7575
To reveal a specific control — e.g. a row after a search — use `scroll_into_view` with the target control's id:
7676

7777
```abap
78-
client->action( val = client->cs_event-scroll_into_view
78+
client->action->gen( val = client->cs_event-scroll_into_view
7979
t_arg = VALUE #( ( `id_row_42` ) ) ).
8080
```
8181

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

8484
```abap
85-
client->action( val = client->cs_event-scroll_into_view
85+
client->action->gen( val = client->cs_event-scroll_into_view
8686
t_arg = VALUE #( ( `id_row_42` ) ( `smooth` ) ( `center` ) ) ).
8787
```

docs/cookbook/browser_interaction/soft_keyboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ METHOD z2ui5_if_app~main.
3636
3737
CASE client->get( )-event.
3838
WHEN `CALL_KEYBOARD`.
39-
client->action( val = client->cs_event-keyboard_set_mode
39+
client->action->gen( val = client->cs_event-keyboard_set_mode
4040
t_arg = VALUE #( ( `ZINPUT` ) ( `none` ) ) ).
4141
WHEN `BACK`.
4242
client->nav_app_leave( ).

docs/cookbook/browser_interaction/timer.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ 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->action(
11+
client->action->gen(
1212
val = client->cs_event-start_timer
1313
t_arg = VALUE #( ( `REFRESH` ) ( `2000` ) ) ).
1414
```
@@ -38,13 +38,13 @@ CLASS z2ui5_cl_sample_timer IMPLEMENTATION.
3838
)->page( `abap2UI5 - Timer`
3939
)->text( client->_bind( counter )
4040
)->stringify( ) ).
41-
client->action( val = client->cs_event-start_timer
41+
client->action->gen( val = client->cs_event-start_timer
4242
t_arg = VALUE #( ( `TICK` ) ( `2000` ) ) ).
4343
4444
WHEN client->check_on_event( `TICK` ).
4545
counter = counter + 1.
4646
client->view_model_update( ).
47-
client->action( val = client->cs_event-start_timer
47+
client->action->gen( val = client->cs_event-start_timer
4848
t_arg = VALUE #( ( `TICK` ) ( `2000` ) ) ).
4949
5050
ENDCASE.
@@ -61,11 +61,11 @@ A single `start_timer` call fires once — perfect for a deferred action like op
6161

6262
```abap
6363
WHEN client->check_on_event( `BUTTON_OPEN_NEW_TAB` ).
64-
client->action( val = client->cs_event-start_timer
64+
client->action->gen( val = client->cs_event-start_timer
6565
t_arg = VALUE #( ( `FIRE_OPEN_TAB` ) ( `500` ) ) ).
6666
6767
WHEN client->check_on_event( `FIRE_OPEN_TAB` ).
68-
client->action( val = client->cs_event-open_new_tab
68+
client->action->gen( val = client->cs_event-open_new_tab
6969
t_arg = VALUE #( ( `https://www.google.com/search?q=abap2ui5` ) ) ).
7070
```
7171

docs/cookbook/browser_interaction/title.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ METHOD z2ui5_if_app~main.
2323
)->stringify( ) ).
2424
2525
WHEN client->check_on_event( `RENAME` ).
26-
client->action(
26+
client->action->gen(
2727
val = client->cs_event-set_title
2828
t_arg = VALUE #( ( `Invoice 4711` ) ) ).
2929
@@ -37,7 +37,7 @@ METHOD z2ui5_if_app~main.
3737
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`:
3838

3939
```abap
40-
client->action(
40+
client->action->gen(
4141
val = client->cs_event-set_title_launchpad
4242
t_arg = VALUE #( ( `Invoice 4711` ) ) ).
4343
```

docs/cookbook/browser_interaction/url_handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ 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->action(
19+
client->action->gen(
2020
val = client->cs_event-open_new_tab
2121
t_arg = VALUE #( ( lv_url ) ) ).
2222
```

docs/cookbook/device_capabilities/audio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ CLASS z2ui5_cl_sample_sound IMPLEMENTATION.
3737
3838
IF client->get( )-event = `CHECK_INPUT`.
3939
IF company_code IS INITIAL.
40-
client->action( val = client->cs_event-play_audio
40+
client->action->gen( val = client->cs_event-play_audio
4141
t_arg = VALUE #( ( `/SAP/PUBLIC/BC/ABAP/mime_demo/bam.wav` ) ) ).
4242
client->message_box_display( type = `error` text = `Input is empty!` ).
4343
ELSE.

docs/cookbook/device_capabilities/barcode_scanning.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ CLASS z2ui5_cl_sample_focus IMPLEMENTATION.
8686
8787
CASE client->get( )-event.
8888
WHEN `ONE_ENTER`.
89-
client->action( val = client->cs_event-set_focus
89+
client->action->gen( val = client->cs_event-set_focus
9090
t_arg = VALUE #( ( `id2` ) ) ).
9191
WHEN `TWO_ENTER`.
92-
client->action( val = client->cs_event-set_focus
92+
client->action->gen( val = client->cs_event-set_focus
9393
t_arg = VALUE #( ( `id1` ) ) ).
9494
ENDCASE.
9595
@@ -131,7 +131,7 @@ CLASS z2ui5_cl_sample_sound IMPLEMENTATION.
131131
132132
IF client->get( )-event = `CHECK_INPUT`.
133133
IF company_code IS INITIAL.
134-
client->action( val = client->cs_event-play_audio
134+
client->action->gen( val = client->cs_event-play_audio
135135
t_arg = VALUE #( ( `/SAP/PUBLIC/BC/ABAP/mime_demo/bam.wav` ) ) ).
136136
client->message_box_display( type = `error` text = `Input is empty!` ).
137137
ELSE.

docs/cookbook/device_capabilities/pdf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ENDMETHOD.
4141
To let the user save the PDF rather than view it inline, use the [file download](./upload_download.md) pattern:
4242

4343
```abap
44-
client->action(
44+
client->action->gen(
4545
val = client->cs_event-download_b64_file
4646
t_arg = VALUE #( ( `data:application/pdf;base64,` && lv_base64 )
4747
( `invoice_4711.pdf` ) ) ).

0 commit comments

Comments
 (0)