diff --git a/AGENTS.md b/AGENTS.md index 1e0026c2..a0d84dc1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -774,10 +774,10 @@ follow these so new/edited samples stay consistent: - `(C)` — uses an abap2UI5 **custom control** (`view->_z2ui5( )->…`, or the `z2ui5` cc namespace: `_generic( … ns = `z2ui5` … )`, `z2ui5.cc`, `xmlns:z2ui5`). - `(A)` — performs a **frontend action**: `client->_event_client( )`, - `client->follow_up_action( )`, `control_call`/`control_call_by_id`, - `binding_call`/`binding_call_by_id`, or a client-side interaction like - drag-and-drop. The ubiquitous back-button `client->_event_nav_app_leave( )` - does **not** count. + `client->follow_up_action( )` (including the `cs_event-control_by_id` / + `cs_event-control_global` / `cs_event-binding_call` events), or a + client-side interaction like drag-and-drop. The ubiquitous back-button + `client->_event_nav_app_leave( )` does **not** count. - `(A,C)` — both. Regenerate the overviews after changing any DESCRIPT (§4). - **A read-only info form disables its inputs** (`enabled = abap_false`) — do not diff --git a/src/01/01/z2ui5_cl_demo_app_001.clas.abap b/src/01/01/z2ui5_cl_demo_app_001.clas.abap deleted file mode 100644 index 16e21483..00000000 --- a/src/01/01/z2ui5_cl_demo_app_001.clas.abap +++ /dev/null @@ -1,58 +0,0 @@ -CLASS z2ui5_cl_demo_app_001 DEFINITION PUBLIC. - - PUBLIC SECTION. - INTERFACES z2ui5_if_app. - - DATA product TYPE string. - DATA quantity TYPE string. - - PROTECTED SECTION. - PRIVATE SECTION. -ENDCLASS. - - -CLASS z2ui5_cl_demo_app_001 IMPLEMENTATION. - - METHOD z2ui5_if_app~main. - - IF client->check_on_init( ). - - product = `products`. - quantity = `500`. - - DATA(view) = z2ui5_cl_xml_view=>factory( ). - DATA(page) = view->shell( - )->page( - title = `abap2UI5 - First Example` - navbuttonpress = client->_event_nav_app_leave( ) - shownavbutton = client->check_app_prev_stack( ) ). - - page->message_strip( - text = `The first abap2UI5 app: an editable quantity field bound two-way, a read-only ` && - `product field, and a button that sends both values to the server.` - type = `Information` - showicon = abap_true - class = `sapUiSmallMargin` ). - - page->simple_form( - title = `Form Title` - editable = abap_true - )->content( `form` - )->label( `quantity` - )->input( client->_bind_edit( quantity ) - )->label( `product` - )->input( - value = product - enabled = abap_false - )->button( - text = `post` - press = client->_event( `BUTTON_POST` ) ). - client->view_display( view->stringify( ) ). - - ELSEIF client->check_on_event( `BUTTON_POST` ). - client->message_toast_display( |{ product } { quantity } - send to the server| ). - ENDIF. - - ENDMETHOD. - -ENDCLASS. diff --git a/src/01/01/z2ui5_cl_demo_app_001.clas.xml b/src/01/01/z2ui5_cl_demo_app_001.clas.xml deleted file mode 100644 index 51ca120d..00000000 --- a/src/01/01/z2ui5_cl_demo_app_001.clas.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Z2UI5_CL_DEMO_APP_001 - E - Binding - Level Simple - 1 - X - X - X - - - - diff --git a/src/01/01/z2ui5_cl_demo_app_025.clas.abap b/src/01/01/z2ui5_cl_demo_app_025.clas.abap index 4531cf19..ad775f51 100644 --- a/src/01/01/z2ui5_cl_demo_app_025.clas.abap +++ b/src/01/01/z2ui5_cl_demo_app_025.clas.abap @@ -50,9 +50,6 @@ CLASS z2ui5_cl_demo_app_025 IMPLEMENTATION. WHEN `BUTTON_RESTART`. client->nav_app_call( NEW z2ui5_cl_demo_app_025( ) ). - WHEN `BUTTON_CHANGE_APP`. - client->nav_app_call( NEW z2ui5_cl_demo_app_001( ) ). - WHEN `BUTTON_READ_PREVIOUS`. DATA(app_024) = CAST z2ui5_cl_demo_app_024( client->get_app( client->get( )-s_draft-id_prev_app ) ). input_previous = app_024->input2. diff --git a/src/01/01/z2ui5_cl_demo_app_446.clas.abap b/src/01/01/z2ui5_cl_demo_app_446.clas.abap index 202f8ab7..d9aeda6b 100644 --- a/src/01/01/z2ui5_cl_demo_app_446.clas.abap +++ b/src/01/01/z2ui5_cl_demo_app_446.clas.abap @@ -32,24 +32,28 @@ CLASS z2ui5_cl_demo_app_446 IMPLEMENTATION. CASE client->get( )-event. WHEN `TOAST`. - client->control_call( object = `MESSAGE_TOAST` - method = `show` - params = VALUE #( ( `Hello from control_call!` ) ) ). + client->follow_up_action( val = z2ui5_if_client=>cs_event-control_global + t_arg = VALUE #( ( `MESSAGE_TOAST` ) + ( `show` ) + ( `Hello from CONTROL_GLOBAL!` ) ) ). WHEN `MSGBOX`. - client->control_call( object = `MESSAGE_BOX` - method = `show` - params = VALUE #( ( `A message box, opened via control_call.` ) ) ). + client->follow_up_action( val = z2ui5_if_client=>cs_event-control_global + t_arg = VALUE #( ( `MESSAGE_BOX` ) + ( `show` ) + ( `A message box, opened via CONTROL_GLOBAL.` ) ) ). WHEN `THEME_DARK`. - client->control_call( object = `THEMING` - method = `setTheme` - params = VALUE #( ( `sap_horizon_dark` ) ) ). + client->follow_up_action( val = z2ui5_if_client=>cs_event-control_global + t_arg = VALUE #( ( `THEMING` ) + ( `setTheme` ) + ( `sap_horizon_dark` ) ) ). WHEN `THEME_LIGHT`. - client->control_call( object = `THEMING` - method = `setTheme` - params = VALUE #( ( `sap_horizon` ) ) ). + client->follow_up_action( val = z2ui5_if_client=>cs_event-control_global + t_arg = VALUE #( ( `THEMING` ) + ( `setTheme` ) + ( `sap_horizon` ) ) ). ENDCASE. @@ -64,14 +68,14 @@ CLASS z2ui5_cl_demo_app_446 IMPLEMENTATION. DATA(page) = view->shell( )->page( - title = `abap2UI5 - Action - control_call` + title = `abap2UI5 - Action - CONTROL_GLOBAL` navbuttonpress = client->_event_nav_app_leave( ) shownavbutton = client->check_app_prev_stack( ) ). page->message_strip( - text = `Each button lets the backend call a method on a global frontend object ` && - `(MessageToast, MessageBox, Theming) - client-side, after the response renders, ` && - `without wiring a control event.` + text = `Each button lets the backend call a whitelisted method on a global frontend object ` && + `(MessageToast, MessageBox, Theming) via follow_up_action( cs_event-control_global ) - ` && + `client-side, after the response renders, without wiring a control event.` type = `Information` showicon = abap_true class = `sapUiSmallMargin` ). diff --git a/src/01/01/z2ui5_cl_demo_app_447.clas.abap b/src/01/01/z2ui5_cl_demo_app_447.clas.abap index 343098ec..f3d85f14 100644 --- a/src/01/01/z2ui5_cl_demo_app_447.clas.abap +++ b/src/01/01/z2ui5_cl_demo_app_447.clas.abap @@ -46,14 +46,19 @@ CLASS z2ui5_cl_demo_app_447 IMPLEMENTATION. CASE client->get( )-event. + " t_arg is positional: id, view (`` = global lookup), method, params WHEN `FOCUS`. - client->control_call_by_id( id = `nameInput` - method = `focus` ). + client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id + t_arg = VALUE #( ( `nameInput` ) + ( `` ) + ( `focus` ) ) ). WHEN `SCROLL`. - client->control_call_by_id( id = `bigTable` - method = `scrollToIndex` - params = VALUE #( ( `25` ) ) ). + client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id + t_arg = VALUE #( ( `bigTable` ) + ( `` ) + ( `scrollToIndex` ) + ( `25` ) ) ). ENDCASE. @@ -68,13 +73,14 @@ CLASS z2ui5_cl_demo_app_447 IMPLEMENTATION. DATA(page) = view->shell( )->page( - title = `abap2UI5 - Action - control_call_by_id` + title = `abap2UI5 - Action - CONTROL_BY_ID` navbuttonpress = client->_event_nav_app_leave( ) shownavbutton = client->check_app_prev_stack( ) ). page->message_strip( - text = `The backend calls a whitelisted method on a control resolved by id, after the ` && - `response renders: focus() on the input, scrollToIndex() on the table.` + text = `The backend calls a whitelisted method on a control resolved by id via ` && + `follow_up_action( cs_event-control_by_id ), after the response renders: ` && + `focus() on the input, scrollToIndex() on the table.` type = `Information` showicon = abap_true class = `sapUiSmallMargin` ). diff --git a/src/01/02/z2ui5_cl_demo_app_088.clas.abap b/src/01/02/z2ui5_cl_demo_app_088.clas.abap index 1a53b82c..b5ccc92d 100644 --- a/src/01/02/z2ui5_cl_demo_app_088.clas.abap +++ b/src/01/02/z2ui5_cl_demo_app_088.clas.abap @@ -57,13 +57,14 @@ CLASS z2ui5_cl_demo_app_088 IMPLEMENTATION. page->message_strip( text = `Selecting a tab in the IconTabHeader switches the NavContainer page on the client via the ` && - `nav_container_to front-end action, without a backend roundtrip.` + `generic CONTROL_BY_ID front-end action (whitelisted method 'to'), without a backend roundtrip.` type = `Information` showicon = abap_true class = `sapUiSmallMargin` ). page->icon_tab_header( selectedkey = client->_bind_edit( mv_selected_key ) - select = client->_event_client( val = client->cs_event-nav_container_to t_arg = VALUE #( ( `NavCon` ) ( `${$parameters>/selectedKey}` ) ) ) + select = client->_event_client( val = client->cs_event-control_by_id + t_arg = VALUE #( ( `NavCon` ) ( `MAIN` ) ( `to` ) ( `${$parameters>/selectedKey}` ) ) ) mode = `Inline` )->items( )->icon_tab_filter( key = `page1` diff --git a/src/01/02/z2ui5_cl_demo_app_170.clas.abap b/src/01/02/z2ui5_cl_demo_app_170.clas.abap index 51fb15f4..3b01cf0b 100644 --- a/src/01/02/z2ui5_cl_demo_app_170.clas.abap +++ b/src/01/02/z2ui5_cl_demo_app_170.clas.abap @@ -28,7 +28,8 @@ CLASS z2ui5_cl_demo_app_170 IMPLEMENTATION. )->content( ). DATA(content) = dialog->icon_tab_bar( selectedkey = client->_bind_edit( mv_selected_key ) - select = client->_event_client( val = `POPUP_NAV_CONTAINER_TO` t_arg = VALUE #( ( `NavCon` ) ( `${$parameters>/selectedKey}` ) ) ) + select = client->_event_client( val = client->cs_event-control_by_id + t_arg = VALUE #( ( `NavCon` ) ( `POPUP` ) ( `to` ) ( `${$parameters>/selectedKey}` ) ) ) headermode = `Inline` expanded = abap_true expandable = abap_false diff --git a/src/01/02/z2ui5_cl_demo_app_202.clas.abap b/src/01/02/z2ui5_cl_demo_app_202.clas.abap index c73a4179..946819d1 100644 --- a/src/01/02/z2ui5_cl_demo_app_202.clas.abap +++ b/src/01/02/z2ui5_cl_demo_app_202.clas.abap @@ -81,15 +81,16 @@ CLASS Z2UI5_CL_DEMO_APP_202 IMPLEMENTATION. ENDIF. CASE client->get( )-event. - WHEN `STEP22`. + WHEN `STEP22` OR `STEP23`. + " the original wizard flow (discardProgress + setNextStep) as two + " generic whitelisted control calls - t_arg is positional: + " id, view, method, params (the step params are control ids) client->follow_up_action( - val = z2ui5_if_client=>cs_event-wizard_set_next_step - t_arg = VALUE #( ( `wiz` ) ( `STEP2` ) ( `STEP22` ) ) ). - - WHEN `STEP23`. + val = z2ui5_if_client=>cs_event-control_by_id + t_arg = VALUE #( ( `wiz` ) ( `MAIN` ) ( `discardProgress` ) ( `STEP2` ) ) ). client->follow_up_action( - val = z2ui5_if_client=>cs_event-wizard_set_next_step - t_arg = VALUE #( ( `wiz` ) ( `STEP2` ) ( `STEP23` ) ) ). + val = z2ui5_if_client=>cs_event-control_by_id + t_arg = VALUE #( ( `STEP2` ) ( `MAIN` ) ( `setNextStep` ) ( client->get( )-event ) ) ). ENDCASE. client->view_model_update( ). diff --git a/src/01/02/z2ui5_cl_demo_app_448.clas.abap b/src/01/02/z2ui5_cl_demo_app_448.clas.abap index 3f775e5e..a694de02 100644 --- a/src/01/02/z2ui5_cl_demo_app_448.clas.abap +++ b/src/01/02/z2ui5_cl_demo_app_448.clas.abap @@ -35,11 +35,14 @@ CLASS z2ui5_cl_demo_app_448 IMPLEMENTATION. WHEN `TOGGLE`. " invert the mirrored state and call the whitelisted setExpanded on - " the panel - client-side, after the response renders, no rebuild + " the panel - client-side, after the response renders, no rebuild. + " t_arg is positional: id, view (`` = global lookup), method, params expanded = xsdbool( expanded = abap_false ). - client->control_call_by_id( id = `demoPanel` - method = `setExpanded` - params = VALUE #( ( CONV string( expanded ) ) ) ). + client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id + t_arg = VALUE #( ( `demoPanel` ) + ( `` ) + ( `setExpanded` ) + ( CONV string( expanded ) ) ) ). ENDCASE. @@ -52,13 +55,13 @@ CLASS z2ui5_cl_demo_app_448 IMPLEMENTATION. DATA(page) = view->shell( )->page( - title = `abap2UI5 - Panel - setExpanded via control_call_by_id` + title = `abap2UI5 - Panel - setExpanded via CONTROL_BY_ID` navbuttonpress = client->_event_nav_app_leave( ) shownavbutton = client->check_app_prev_stack( ) ). page->message_strip( text = `The button toggles the panel via the whitelisted setExpanded method ` && - `(control_call_by_id), client-side after render - no view rebuild.` + `(follow_up_action with cs_event-control_by_id), client-side after render - no view rebuild.` type = `Information` showicon = abap_true class = `sapUiSmallMargin` ). diff --git a/src/01/02/z2ui5_cl_demo_app_449.clas.abap b/src/01/02/z2ui5_cl_demo_app_449.clas.abap index 623dd4fa..eec825a2 100644 --- a/src/01/02/z2ui5_cl_demo_app_449.clas.abap +++ b/src/01/02/z2ui5_cl_demo_app_449.clas.abap @@ -33,9 +33,12 @@ CLASS z2ui5_cl_demo_app_449 IMPLEMENTATION. WHEN `OPEN`. " open the popup-mode PDFViewer via the whitelisted open method - - " the viewer brings its own dialog and close button - client->control_call_by_id( id = `demoPdf` - method = `open` ). + " the viewer brings its own dialog and close button. + " t_arg is positional: id, view (`` = global lookup), method + client->follow_up_action( val = z2ui5_if_client=>cs_event-control_by_id + t_arg = VALUE #( ( `demoPdf` ) + ( `` ) + ( `open` ) ) ). ENDCASE. @@ -48,7 +51,7 @@ CLASS z2ui5_cl_demo_app_449 IMPLEMENTATION. DATA(page) = view->shell( )->page( - title = `abap2UI5 - PDF Viewer - Display via control_call_by_id` + title = `abap2UI5 - PDF Viewer - Display via CONTROL_BY_ID` navbuttonpress = client->_event_nav_app_leave( ) shownavbutton = client->check_app_prev_stack( ) ). @@ -63,7 +66,7 @@ CLASS z2ui5_cl_demo_app_449 IMPLEMENTATION. page->message_strip( text = `The button opens the popup-mode PDFViewer via the whitelisted open method ` && - `(control_call_by_id), client-side after render.` + `(follow_up_action with cs_event-control_by_id), client-side after render.` type = `Information` showicon = abap_true class = `sapUiSmallMargin` ). diff --git a/src/01/02/z2ui5_cl_demo_app_454.clas.abap b/src/01/02/z2ui5_cl_demo_app_454.clas.abap index 163860fd..a1cf70b5 100644 --- a/src/01/02/z2ui5_cl_demo_app_454.clas.abap +++ b/src/01/02/z2ui5_cl_demo_app_454.clas.abap @@ -52,18 +52,24 @@ CLASS Z2UI5_CL_DEMO_APP_454 IMPLEMENTATION. " client-side after the response renders. The model data stays " untouched (no table copy, no view_model_update); an empty query " clears the filter again. - client->binding_call_by_id( id = `productList` - params = VALUE #( ( `NAME` ) - ( `Contains` ) - ( client->get_event_arg( ) ) ) ). + " t_arg is positional: id, aggregation, method, params + client->follow_up_action( val = z2ui5_if_client=>cs_event-binding_call + t_arg = VALUE #( ( `productList` ) + ( `items` ) + ( `filter` ) + ( `NAME` ) + ( `Contains` ) + ( client->get_event_arg( ) ) ) ). WHEN `SORT_ASC` OR `SORT_DESC`. - client->binding_call_by_id( id = `productList` - method = `sort` - params = VALUE #( ( `NAME` ) - ( COND #( WHEN client->get( )-event = `SORT_DESC` - THEN `true` - ELSE `false` ) ) ) ). + client->follow_up_action( val = z2ui5_if_client=>cs_event-binding_call + t_arg = VALUE #( ( `productList` ) + ( `items` ) + ( `sort` ) + ( `NAME` ) + ( COND #( WHEN client->get( )-event = `SORT_DESC` + THEN `true` + ELSE `false` ) ) ) ). ENDCASE. @@ -81,8 +87,9 @@ CLASS Z2UI5_CL_DEMO_APP_454 IMPLEMENTATION. shownavbutton = client->check_app_prev_stack( ) ). page->message_strip( - text = `Search and sort are applied to the list's items BINDING via binding_call_by_id ` && - `- the UI5 controller pattern getBinding('items').filter(...). The model stays untouched.` + text = `Search and sort are applied to the list's items BINDING via follow_up_action ` && + `with cs_event-binding_call - the UI5 controller pattern getBinding('items').filter(...). ` && + `The model stays untouched.` type = `Information` showicon = abap_true class = `sapUiSmallMargin` ). diff --git a/src/01/z2ui5_cl_demo_app_g00.clas.abap b/src/01/z2ui5_cl_demo_app_g00.clas.abap index f86b89d2..f7e2caf8 100644 --- a/src/01/z2ui5_cl_demo_app_g00.clas.abap +++ b/src/01/z2ui5_cl_demo_app_g00.clas.abap @@ -211,7 +211,6 @@ CLASS z2ui5_cl_demo_app_g00 IMPLEMENTATION. ( group = `Basic I` header = `Binding` sub = `Expression Binding` app = `z2ui5_cl_demo_app_027` ) ( group = `Basic I` header = `Binding` sub = `Formatting Currencies` app = `z2ui5_cl_demo_app_067` ) ( group = `Basic I` header = `Binding` sub = `Formatting Integers, Decimals, Dates & Time` app = `z2ui5_cl_demo_app_047` ) - ( group = `Basic I` header = `Binding` sub = `Level Simple` app = `z2ui5_cl_demo_app_001` ) ( group = `Basic I` header = `Binding` sub = `Level Structure/Component` app = `z2ui5_cl_demo_app_166` ) ( group = `Basic I` header = `Binding` sub = `Level Table/Cell` app = `z2ui5_cl_demo_app_144` ) ( group = `Basic I` header = `Event` sub = `Additional Infos with t_args` app = `z2ui5_cl_demo_app_167` )