Skip to content

Commit a94f536

Browse files
oblomov-devclaude
andauthored
Migrate control/binding calls to follow_up_action API (#686)
* refactor: use follow_up_action events instead of removed control/binding call methods The framework consolidates control_call, control_call_by_id and binding_call_by_id into follow_up_action with the new cs_event constants control_global, control_by_id and binding_call. Migrate demo apps 446-449 and 454 to the event-based calls and update titles/strip texts and the AGENTS.md capability-marker description accordingly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3dtkgTSRc98yDRUUDVd1q * refactor: migrate nav-container/wizard samples to CONTROL_BY_ID, remove demo app 001 Apps 088 and 170 wire NavContainer tab navigation directly to the generic cs_event-control_by_id client event (whitelisted method 'to') instead of the legacy *_nav_container_to remap events. App 202 expresses the wizard step flow as two generic control calls (discardProgress + setNextStep, whitelisted upstream) instead of the dedicated WIZARD_SET_NEXT_STEP event. Remove z2ui5_cl_demo_app_001 (Binding - Level Simple) including its overview tile (catalog regenerated via npm run launchpad) and the dead BUTTON_CHANGE_APP handler in app 025 that navigated to it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3dtkgTSRc98yDRUUDVd1q --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2de1f88 commit a94f536

13 files changed

Lines changed: 87 additions & 139 deletions

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,10 @@ follow these so new/edited samples stay consistent:
774774
- `(C)` — uses an abap2UI5 **custom control** (`view->_z2ui5( )->…`, or the
775775
`z2ui5` cc namespace: `_generic( … ns = `z2ui5` … )`, `z2ui5.cc`, `xmlns:z2ui5`).
776776
- `(A)` — performs a **frontend action**: `client->_event_client( )`,
777-
`client->follow_up_action( )`, `control_call`/`control_call_by_id`,
778-
`binding_call`/`binding_call_by_id`, or a client-side interaction like
779-
drag-and-drop. The ubiquitous back-button `client->_event_nav_app_leave( )`
780-
does **not** count.
777+
`client->follow_up_action( )` (including the `cs_event-control_by_id` /
778+
`cs_event-control_global` / `cs_event-binding_call` events), or a
779+
client-side interaction like drag-and-drop. The ubiquitous back-button
780+
`client->_event_nav_app_leave( )` does **not** count.
781781
- `(A,C)` — both. Regenerate the overviews after changing any DESCRIPT (§4).
782782

783783
- **A read-only info form disables its inputs** (`enabled = abap_false`) — do not

src/01/01/z2ui5_cl_demo_app_001.clas.abap

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/01/01/z2ui5_cl_demo_app_001.clas.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/01/01/z2ui5_cl_demo_app_025.clas.abap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ CLASS z2ui5_cl_demo_app_025 IMPLEMENTATION.
5050
WHEN `BUTTON_RESTART`.
5151
client->nav_app_call( NEW z2ui5_cl_demo_app_025( ) ).
5252

53-
WHEN `BUTTON_CHANGE_APP`.
54-
client->nav_app_call( NEW z2ui5_cl_demo_app_001( ) ).
55-
5653
WHEN `BUTTON_READ_PREVIOUS`.
5754
DATA(app_024) = CAST z2ui5_cl_demo_app_024( client->get_app( client->get( )-s_draft-id_prev_app ) ).
5855
input_previous = app_024->input2.

src/01/01/z2ui5_cl_demo_app_446.clas.abap

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,28 @@ CLASS z2ui5_cl_demo_app_446 IMPLEMENTATION.
3232
CASE client->get( )-event.
3333

3434
WHEN `TOAST`.
35-
client->control_call( object = `MESSAGE_TOAST`
36-
method = `show`
37-
params = VALUE #( ( `Hello from control_call!` ) ) ).
35+
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_global
36+
t_arg = VALUE #( ( `MESSAGE_TOAST` )
37+
( `show` )
38+
( `Hello from CONTROL_GLOBAL!` ) ) ).
3839

3940
WHEN `MSGBOX`.
40-
client->control_call( object = `MESSAGE_BOX`
41-
method = `show`
42-
params = VALUE #( ( `A message box, opened via control_call.` ) ) ).
41+
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_global
42+
t_arg = VALUE #( ( `MESSAGE_BOX` )
43+
( `show` )
44+
( `A message box, opened via CONTROL_GLOBAL.` ) ) ).
4345

4446
WHEN `THEME_DARK`.
45-
client->control_call( object = `THEMING`
46-
method = `setTheme`
47-
params = VALUE #( ( `sap_horizon_dark` ) ) ).
47+
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_global
48+
t_arg = VALUE #( ( `THEMING` )
49+
( `setTheme` )
50+
( `sap_horizon_dark` ) ) ).
4851

4952
WHEN `THEME_LIGHT`.
50-
client->control_call( object = `THEMING`
51-
method = `setTheme`
52-
params = VALUE #( ( `sap_horizon` ) ) ).
53+
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_global
54+
t_arg = VALUE #( ( `THEMING` )
55+
( `setTheme` )
56+
( `sap_horizon` ) ) ).
5357

5458
ENDCASE.
5559

@@ -64,14 +68,14 @@ CLASS z2ui5_cl_demo_app_446 IMPLEMENTATION.
6468

6569
DATA(page) = view->shell(
6670
)->page(
67-
title = `abap2UI5 - Action - control_call`
71+
title = `abap2UI5 - Action - CONTROL_GLOBAL`
6872
navbuttonpress = client->_event_nav_app_leave( )
6973
shownavbutton = client->check_app_prev_stack( ) ).
7074

7175
page->message_strip(
72-
text = `Each button lets the backend call a method on a global frontend object ` &&
73-
`(MessageToast, MessageBox, Theming) - client-side, after the response renders, ` &&
74-
`without wiring a control event.`
76+
text = `Each button lets the backend call a whitelisted method on a global frontend object ` &&
77+
`(MessageToast, MessageBox, Theming) via follow_up_action( cs_event-control_global ) - ` &&
78+
`client-side, after the response renders, without wiring a control event.`
7579
type = `Information`
7680
showicon = abap_true
7781
class = `sapUiSmallMargin` ).

src/01/01/z2ui5_cl_demo_app_447.clas.abap

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,19 @@ CLASS z2ui5_cl_demo_app_447 IMPLEMENTATION.
4646

4747
CASE client->get( )-event.
4848

49+
" t_arg is positional: id, view (`` = global lookup), method, params
4950
WHEN `FOCUS`.
50-
client->control_call_by_id( id = `nameInput`
51-
method = `focus` ).
51+
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id
52+
t_arg = VALUE #( ( `nameInput` )
53+
( `` )
54+
( `focus` ) ) ).
5255

5356
WHEN `SCROLL`.
54-
client->control_call_by_id( id = `bigTable`
55-
method = `scrollToIndex`
56-
params = VALUE #( ( `25` ) ) ).
57+
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id
58+
t_arg = VALUE #( ( `bigTable` )
59+
( `` )
60+
( `scrollToIndex` )
61+
( `25` ) ) ).
5762

5863
ENDCASE.
5964

@@ -68,13 +73,14 @@ CLASS z2ui5_cl_demo_app_447 IMPLEMENTATION.
6873

6974
DATA(page) = view->shell(
7075
)->page(
71-
title = `abap2UI5 - Action - control_call_by_id`
76+
title = `abap2UI5 - Action - CONTROL_BY_ID`
7277
navbuttonpress = client->_event_nav_app_leave( )
7378
shownavbutton = client->check_app_prev_stack( ) ).
7479

7580
page->message_strip(
76-
text = `The backend calls a whitelisted method on a control resolved by id, after the ` &&
77-
`response renders: focus() on the input, scrollToIndex() on the table.`
81+
text = `The backend calls a whitelisted method on a control resolved by id via ` &&
82+
`follow_up_action( cs_event-control_by_id ), after the response renders: ` &&
83+
`focus() on the input, scrollToIndex() on the table.`
7884
type = `Information`
7985
showicon = abap_true
8086
class = `sapUiSmallMargin` ).

src/01/02/z2ui5_cl_demo_app_088.clas.abap

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ CLASS z2ui5_cl_demo_app_088 IMPLEMENTATION.
5757

5858
page->message_strip(
5959
text = `Selecting a tab in the IconTabHeader switches the NavContainer page on the client via the ` &&
60-
`nav_container_to front-end action, without a backend roundtrip.`
60+
`generic CONTROL_BY_ID front-end action (whitelisted method 'to'), without a backend roundtrip.`
6161
type = `Information`
6262
showicon = abap_true
6363
class = `sapUiSmallMargin` ).
6464

6565
page->icon_tab_header( selectedkey = client->_bind_edit( mv_selected_key )
66-
select = client->_event_client( val = client->cs_event-nav_container_to t_arg = VALUE #( ( `NavCon` ) ( `${$parameters>/selectedKey}` ) ) )
66+
select = client->_event_client( val = client->cs_event-control_by_id
67+
t_arg = VALUE #( ( `NavCon` ) ( `MAIN` ) ( `to` ) ( `${$parameters>/selectedKey}` ) ) )
6768
mode = `Inline`
6869
)->items(
6970
)->icon_tab_filter( key = `page1`

src/01/02/z2ui5_cl_demo_app_170.clas.abap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ CLASS z2ui5_cl_demo_app_170 IMPLEMENTATION.
2828
)->content( ).
2929

3030
DATA(content) = dialog->icon_tab_bar( selectedkey = client->_bind_edit( mv_selected_key )
31-
select = client->_event_client( val = `POPUP_NAV_CONTAINER_TO` t_arg = VALUE #( ( `NavCon` ) ( `${$parameters>/selectedKey}` ) ) )
31+
select = client->_event_client( val = client->cs_event-control_by_id
32+
t_arg = VALUE #( ( `NavCon` ) ( `POPUP` ) ( `to` ) ( `${$parameters>/selectedKey}` ) ) )
3233
headermode = `Inline`
3334
expanded = abap_true
3435
expandable = abap_false

src/01/02/z2ui5_cl_demo_app_202.clas.abap

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,16 @@ CLASS Z2UI5_CL_DEMO_APP_202 IMPLEMENTATION.
8181
ENDIF.
8282

8383
CASE client->get( )-event.
84-
WHEN `STEP22`.
84+
WHEN `STEP22` OR `STEP23`.
85+
" the original wizard flow (discardProgress + setNextStep) as two
86+
" generic whitelisted control calls - t_arg is positional:
87+
" id, view, method, params (the step params are control ids)
8588
client->follow_up_action(
86-
val = z2ui5_if_client=>cs_event-wizard_set_next_step
87-
t_arg = VALUE #( ( `wiz` ) ( `STEP2` ) ( `STEP22` ) ) ).
88-
89-
WHEN `STEP23`.
89+
val = z2ui5_if_client=>cs_event-control_by_id
90+
t_arg = VALUE #( ( `wiz` ) ( `MAIN` ) ( `discardProgress` ) ( `STEP2` ) ) ).
9091
client->follow_up_action(
91-
val = z2ui5_if_client=>cs_event-wizard_set_next_step
92-
t_arg = VALUE #( ( `wiz` ) ( `STEP2` ) ( `STEP23` ) ) ).
92+
val = z2ui5_if_client=>cs_event-control_by_id
93+
t_arg = VALUE #( ( `STEP2` ) ( `MAIN` ) ( `setNextStep` ) ( client->get( )-event ) ) ).
9394

9495
ENDCASE.
9596
client->view_model_update( ).

src/01/02/z2ui5_cl_demo_app_448.clas.abap

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ CLASS z2ui5_cl_demo_app_448 IMPLEMENTATION.
3535

3636
WHEN `TOGGLE`.
3737
" invert the mirrored state and call the whitelisted setExpanded on
38-
" the panel - client-side, after the response renders, no rebuild
38+
" the panel - client-side, after the response renders, no rebuild.
39+
" t_arg is positional: id, view (`` = global lookup), method, params
3940
expanded = xsdbool( expanded = abap_false ).
40-
client->control_call_by_id( id = `demoPanel`
41-
method = `setExpanded`
42-
params = VALUE #( ( CONV string( expanded ) ) ) ).
41+
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id
42+
t_arg = VALUE #( ( `demoPanel` )
43+
( `` )
44+
( `setExpanded` )
45+
( CONV string( expanded ) ) ) ).
4346

4447
ENDCASE.
4548

@@ -52,13 +55,13 @@ CLASS z2ui5_cl_demo_app_448 IMPLEMENTATION.
5255

5356
DATA(page) = view->shell(
5457
)->page(
55-
title = `abap2UI5 - Panel - setExpanded via control_call_by_id`
58+
title = `abap2UI5 - Panel - setExpanded via CONTROL_BY_ID`
5659
navbuttonpress = client->_event_nav_app_leave( )
5760
shownavbutton = client->check_app_prev_stack( ) ).
5861

5962
page->message_strip(
6063
text = `The button toggles the panel via the whitelisted setExpanded method ` &&
61-
`(control_call_by_id), client-side after render - no view rebuild.`
64+
`(follow_up_action with cs_event-control_by_id), client-side after render - no view rebuild.`
6265
type = `Information`
6366
showicon = abap_true
6467
class = `sapUiSmallMargin` ).

0 commit comments

Comments
 (0)