Skip to content

Commit 7b5f96a

Browse files
oblomov-devclaude
andauthored
Migrate control_by_id calls to the view parameter (#694)
Drop the positional view slot from control_by_id t_arg in follow_up_action and _event_client calls; pass the view via the new view parameter where it is not the main view (app 170: cs_view-popup). Main-view calls simply omit the slot. Claude-Session: https://claude.ai/code/session_01Ar8FTqFRTaZ9r5jcje9J9n Co-authored-by: Claude <noreply@anthropic.com>
1 parent e21832b commit 7b5f96a

7 files changed

Lines changed: 15 additions & 14 deletions

src/01/01/z2ui5_cl_demo_app_447.clas.abap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,16 @@ 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
49+
" t_arg is positional: id, method, params (the view defaults to
50+
" cs_view-main and can be omitted for a main-view control)
5051
WHEN `FOCUS`.
5152
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id
5253
t_arg = VALUE #( ( `nameInput` )
53-
( `` )
5454
( `focus` ) ) ).
5555

5656
WHEN `SCROLL`.
5757
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id
5858
t_arg = VALUE #( ( `bigTable` )
59-
( `` )
6059
( `scrollToIndex` )
6160
( `25` ) ) ).
6261

src/01/02/z2ui5_cl_demo_app_088.clas.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ CLASS z2ui5_cl_demo_app_088 IMPLEMENTATION.
6464

6565
page->icon_tab_header( selectedkey = client->_bind( mv_selected_key )
6666
select = client->_event_client( val = client->cs_event-control_by_id
67-
t_arg = VALUE #( ( `NavCon` ) ( `MAIN` ) ( `to` ) ( `${$parameters>/selectedKey}` ) ) )
67+
t_arg = VALUE #( ( `NavCon` ) ( `to` ) ( `${$parameters>/selectedKey}` ) ) )
6868
mode = `Inline`
6969
)->items(
7070
)->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
@@ -29,7 +29,8 @@ CLASS z2ui5_cl_demo_app_170 IMPLEMENTATION.
2929

3030
DATA(content) = dialog->icon_tab_bar( selectedkey = client->_bind( mv_selected_key )
3131
select = client->_event_client( val = client->cs_event-control_by_id
32-
t_arg = VALUE #( ( `NavCon` ) ( `POPUP` ) ( `to` ) ( `${$parameters>/selectedKey}` ) ) )
32+
view = client->cs_view-popup
33+
t_arg = VALUE #( ( `NavCon` ) ( `to` ) ( `${$parameters>/selectedKey}` ) ) )
3334
headermode = `Inline`
3435
expanded = abap_true
3536
expandable = abap_false

src/01/02/z2ui5_cl_demo_app_202.clas.abap

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,14 @@ CLASS Z2UI5_CL_DEMO_APP_202 IMPLEMENTATION.
8484
WHEN `STEP22` OR `STEP23`.
8585
" the original wizard flow (discardProgress + setNextStep) as two
8686
" generic whitelisted control calls - t_arg is positional:
87-
" id, view, method, params (the step params are control ids)
87+
" id, method, params (the step params are control ids; the view
88+
" defaults to cs_view-main)
8889
client->follow_up_action(
8990
val = z2ui5_if_client=>cs_event-control_by_id
90-
t_arg = VALUE #( ( `wiz` ) ( `MAIN` ) ( `discardProgress` ) ( `STEP2` ) ) ).
91+
t_arg = VALUE #( ( `wiz` ) ( `discardProgress` ) ( `STEP2` ) ) ).
9192
client->follow_up_action(
9293
val = z2ui5_if_client=>cs_event-control_by_id
93-
t_arg = VALUE #( ( `STEP2` ) ( `MAIN` ) ( `setNextStep` ) ( client->get( )-event ) ) ).
94+
t_arg = VALUE #( ( `STEP2` ) ( `setNextStep` ) ( client->get( )-event ) ) ).
9495

9596
ENDCASE.
9697
client->view_model_update( ).

src/01/02/z2ui5_cl_demo_app_448.clas.abap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ CLASS z2ui5_cl_demo_app_448 IMPLEMENTATION.
3636
WHEN `TOGGLE`.
3737
" invert the mirrored state and call the whitelisted setExpanded on
3838
" the panel - client-side, after the response renders, no rebuild.
39-
" t_arg is positional: id, view (`` = global lookup), method, params
39+
" t_arg is positional: id, method, params (the view defaults to
40+
" cs_view-main and can be omitted for a main-view control)
4041
expanded = xsdbool( expanded = abap_false ).
4142
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id
4243
t_arg = VALUE #( ( `demoPanel` )
43-
( `` )
4444
( `setExpanded` )
4545
( CONV string( expanded ) ) ) ).
4646

src/01/02/z2ui5_cl_demo_app_449.clas.abap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ CLASS z2ui5_cl_demo_app_449 IMPLEMENTATION.
3434
WHEN `OPEN`.
3535
" open the popup-mode PDFViewer via the whitelisted open method -
3636
" the viewer brings its own dialog and close button.
37-
" t_arg is positional: id, view (`` = global lookup), method
37+
" t_arg is positional: id, method (the view defaults to cs_view-main
38+
" and can be omitted for a main-view control)
3839
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id
3940
t_arg = VALUE #( ( `demoPdf` )
40-
( `` )
4141
( `open` ) ) ).
4242

4343
ENDCASE.

src/01/02/z2ui5_cl_demo_app_465.clas.abap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ CLASS z2ui5_cl_demo_app_465 IMPLEMENTATION.
3535
" toggle the popover open/closed, anchored to the pressed button's DOM
3636
" ref - the whitelisted toggleBy opens it if closed, closes it if open
3737
" (the controller pattern oPopover.openBy(oButton) / oPopover.close()).
38-
" t_arg is positional: id, view (`` = global lookup), method, anchor id
38+
" t_arg is positional: id, method, anchor id (the view defaults to
39+
" cs_view-main and can be omitted for a main-view control)
3940
client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id
4041
t_arg = VALUE #( ( `demoPopover` )
41-
( `` )
4242
( `toggleBy` )
4343
( client->get_event_arg( ) ) ) ).
4444

0 commit comments

Comments
 (0)