From 93c4430bb2ea47832e3b33942a4d4e39c5da842a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 17:38:50 +0000 Subject: [PATCH] Open question 14 resolved (b): backend checks for a table behind a data reference A table bound through a data reference is the model node //*, and a backend that looks for its __delta at / only drops every edit of it without an error. Until now only the frontend side had a check; the backend side was an implementation note, because no conformance app bound a data reference. - Conformance app REF (Z2UI5_CL_CONF_REF, ABAP + cap2UI5 twin): MR_TAB and MR_WIN TYPE REF TO data, bound dereferenced, one with _bind( ), one with window_bind_tab( ) in the order QTY descending. - Backend checks model.reference-delta and window.delta-positions-reference (MUST, core): 93 checks. - spec/request.md: the note became the rule; spec/windowed-tables.md Edits names the * node; open question 14 resolved. - node-runtime 1.149.0 passes both - its backend reads the * node, only its frontend sent the edit wrong (fixed in abap2UI5 #3026). cap2UI5 0.6.0 cannot declare a field TYPE REF TO data in a JavaScript app: the twin's start fails, both checks are pinned for cap2ui5 and kept out of the traffic comparison until a plugin with t.ref( ) (cap2UI5/cap2UI5 5085ddc, unreleased) is in the host. With it the twin passes both, byte for byte as the ABAP app (measured, not recorded). - Suite traffic recorded again from both hosts. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014YZFmCjdbLvb757NWCFVeA --- CHANGELOG.md | 26 + README.md | 15 +- conformance/README.md | 2 +- conformance/RESULTS.md | 83 +- conformance/apps/README.md | 14 + .../apps/abap/z2ui5_cl_conf_ref.clas.abap | 179 +++ .../apps/abap/z2ui5_cl_conf_ref.clas.xml | 16 + conformance/apps/cap2ui5/ref.js | 64 + conformance/backend/README.md | 2 + conformance/backend/lib/checks/model.mjs | 23 + conformance/backend/lib/checks/window.mjs | 21 + conformance/backend/lib/runner.mjs | 1 + spec/open-questions.md | 49 +- spec/request.md | 19 +- spec/windowed-tables.md | 6 +- test/lib/expected.mjs | 21 +- test/traffic.test.mjs | 17 +- traffic/cap2ui5/suite.json | 1336 +++++++++-------- traffic/node-runtime/suite.json | 1262 ++++++++++------ 19 files changed, 2040 insertions(+), 1116 deletions(-) create mode 100644 conformance/apps/abap/z2ui5_cl_conf_ref.clas.abap create mode 100644 conformance/apps/abap/z2ui5_cl_conf_ref.clas.xml create mode 100644 conformance/apps/cap2ui5/ref.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f7924d..a891471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,32 @@ ## Unreleased +- **Open question 14 resolved (b): the backend side of a table behind a + data reference gets its checks.** A backend MUST read the entry of such + a table at its model node `//*` - a `__delta` there changes + exactly the named cells, on a windowed table it names positions. + - `spec/request.md`: the implementation note became that rule (*Checked + by:* `model.reference-delta`, `window.delta-positions-reference`); a + whole value at `//*` stays an implementation note. + `spec/windowed-tables.md` *Edits*: the positions rule names the `*` + node. `spec/open-questions.md`: question 14 resolved. + - New conformance app REF (`Z2UI5_CL_CONF_REF`, ABAP and cap2UI5 twin, + `conformance/apps/README.md`): `MR_TAB` and `MR_WIN`, both + `TYPE REF TO data`, bound dereferenced - one with `_bind( )`, one with + `window_bind_tab( )` in the order `QTY` descending. + - Two backend checks (MUST, core) - 93 checks (75 MUST, 18 SHOULD; 86 + core). node-runtime (`@abap2ui5/node-runtime` 1.149.0) passes both: + its backend reads the `*` node, only its frontend sent the edit wrong. + cap2UI5 0.6.0 cannot declare such a field in a JavaScript app; the + twin's start fails there, and both checks are pinned for `cap2ui5` in + `test/lib/expected.mjs` (and kept out of the traffic comparison, + `BACKEND_TRAFFIC_APART`) until a plugin with `t.ref( )` + (cap2UI5/cap2UI5 `5085ddc`, not released) is in the host - with it the + twin passes both and answers as the ABAP app + (`conformance/RESULTS.md`, *Tables behind a data reference*). + - Suite traffic recorded again from both hosts (`traffic/*/suite.json`): + it carries `{ "*": { "__delta" } }` requests now. + - **The row delta of a table behind a data reference** (abap2UI5 #3026, `2cc0344`). An attribute `TYPE REF TO data` bound dereferenced is the model node `//*`; its cell travels as `{ "MR_TAB": { "*": { diff --git a/README.md b/README.md index d0d22b6..eda6175 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,15 @@ source file and method it was derived from ([spec/README.md](spec/README.md#sour - **Protocol 2**, specification revision 0.5, derived from abap2UI5 1.149.0 (its release commit `6f55b04`) - the release that brought windowed tables ([spec/windowed-tables.md](spec/windowed-tables.md)); the - maintainer decided ten open questions in revision 0.3, three are open + maintainer decided ten open questions in revision 0.3, question 14 is + resolved, three are open ([spec/open-questions.md](spec/open-questions.md)). -- **Backend suite: 91 checks** (73 MUST, 18 SHOULD; 84 core, 7 UI5 profile). - Both reference backends pass every MUST - `node-runtime` - (`@abap2ui5/node-runtime` 1.149.0) 91/91, `cap2ui5` - (`@cap2ui5/cds-plugin` 0.6.0, on the same runtime) 90/91 with one SHOULD - warning ([conformance/RESULTS.md](conformance/RESULTS.md)). No failure - is pinned. +- **Backend suite: 93 checks** (75 MUST, 18 SHOULD; 86 core, 7 UI5 profile). + `node-runtime` (`@abap2ui5/node-runtime` 1.149.0) passes 93/93; + `cap2ui5` (`@cap2ui5/cds-plugin` 0.6.0, on the same runtime) 90/93 with + one SHOULD warning and two pinned failures - the two checks of a table + behind a data reference, which need the plugin's `t.ref( )` after 0.6.0 + ([conformance/RESULTS.md](conformance/RESULTS.md)). - **Schemas** validate all 482 recorded requests, 466 responses and 26 agent snapshots, checked by the shipped validator and by ajv. - **Portable profile v1** filled from a census of 247 core apps (73.7 % by diff --git a/conformance/README.md b/conformance/README.md index 1df70a8..5a7c1c9 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -5,7 +5,7 @@ swapped independently: | Suite | Plays | Tests | Status | |---|---|---|---| -| [backend/](backend/README.md) | the frontend | a backend, over HTTP, against the conformance apps | implemented - 91 checks, `abap2ui5-conformance backend` | +| [backend/](backend/README.md) | the frontend | a backend, over HTTP, against the conformance apps | implemented - 93 checks, `abap2ui5-conformance backend` | | [frontend/](frontend/README.md) | the backend | a frontend, by scripted responses (recorded traffic + synthetic edge cases), through an adapter per frontend | implemented - 85 checks, `abap2ui5-conformance frontend --adapter ui5\|agent\|webcomponent\|adaptive-cards` | The **conformance apps** ([apps/](apps/README.md)) are what a backend serves diff --git a/conformance/RESULTS.md b/conformance/RESULTS.md index 0b5cd6b..f41acaa 100644 --- a/conformance/RESULTS.md +++ b/conformance/RESULTS.md @@ -1,30 +1,35 @@ # Results -Backend suite, profile `ui5` (91 checks: 84 core, 7 UI5-profile; 73 MUST, -18 SHOULD), run 2026-11-16 with `npm run conformance:`. The traffic +Backend suite, profile `ui5` (93 checks: 86 core, 7 UI5-profile; 75 MUST, +18 SHOULD), run 2026-11-19 with `npm run conformance:`. The traffic of these runs is recorded in [`../traffic/`](../traffic/). Revision 0.5 moved the node-runtime host to abap2UI5 1.149.0 and added the thirteen checks of the windowed tables (`window.*`) and `model.unconvertible-scalar-skipped` (SHOULD), and moved the cap2UI5 host -to `@cap2ui5/cds-plugin` 0.6.0, which hosts the same runtime: both -reference backends pass every MUST, and no failure is pinned -([`../test/lib/expected.mjs`](../test/lib/expected.mjs); the one pinned -warning is `error.details`). +to `@cap2ui5/cds-plugin` 0.6.0, which hosts the same runtime. Open question +14 added the conformance app REF and two checks of a table behind a data +reference (`model.reference-delta`, `window.delta-positions-reference`): +node-runtime passes every MUST; cap2UI5 0.6.0 fails those two - its +JavaScript apps cannot declare a field `TYPE REF TO data` +([below](#tables-behind-a-data-reference)) - and they are its only pinned +failures ([`../test/lib/expected.mjs`](../test/lib/expected.mjs); the one +pinned warning is `error.details`). | Backend | Version | Apps | Pass | Fail | Warn | Skip | Verdict | |---|---|---|---:|---:|---:|---:|---| -| `node-runtime` | `@abap2ui5/node-runtime` 1.149.0 (abap2UI5 1.149.0, transpiled) | the ABAP apps, transpiled together with the framework by the package's `abap2ui5-transpile` (`@abaplint/transpiler-cli` 2.14.33) | 91 | 0 | 0 | 0 | conformant (ui5) | -| `cap2ui5` | `@cap2ui5/cds-plugin` 0.6.0 on `@abap2ui5/node-runtime` 1.149.0 (the version the plugin pins), `@sap/cds` 10 | the JavaScript apps | 90 | 0 | 1 | 0 | conformant (ui5), one SHOULD warning: `error.details` (below) | +| `node-runtime` | `@abap2ui5/node-runtime` 1.149.0 (abap2UI5 1.149.0, transpiled) | the ABAP apps, transpiled together with the framework by the package's `abap2ui5-transpile` (`@abaplint/transpiler-cli` 2.14.33) | 93 | 0 | 0 | 0 | conformant (ui5) | +| `cap2ui5` | `@cap2ui5/cds-plugin` 0.6.0 on `@abap2ui5/node-runtime` 1.149.0 (the version the plugin pins), `@sap/cds` 10 | the JavaScript apps | 90 | 2 | 1 | 0 | not conformant (ui5): `model.reference-delta` and `window.delta-positions-reference` fail, pinned ([below](#tables-behind-a-data-reference)); one SHOULD warning: `error.details` (below) | -Per area (both backends identical except `error`): +Per area (both backends identical except `error` and the two checks of +the app REF): | Area | Checks | node-runtime | cap2ui5 | |---|---:|---|---| | transport | 8 | 8 pass | 8 pass | | response | 8 | 8 pass | 8 pass | | event | 5 | 5 pass | 5 pass | -| model | 11 | 11 pass | 11 pass | -| window | 13 | 13 pass | 13 pass | +| model | 12 | 12 pass | 11 pass, 1 fail (`model.reference-delta`) | +| window | 14 | 14 pass | 13 pass, 1 fail (`window.delta-positions-reference`) | | message | 4 | 4 pass | 4 pass | | slots | 7 | 7 pass | 7 pass | | action | 3 | 3 pass | 3 pass | @@ -40,8 +45,8 @@ runtime is the same framework source. Both hosts run the same framework release now: cap2UI5 0.6.0 pins `@abap2ui5/node-runtime` 1.149.0, the version the node-runtime host runs (with 0.5.0 the cap2UI5 host was on 1.147.0). The recorded traffic of the -two is identical for every check, the windowed tables included -([below](#differences-between-the-two-backends)). +two is identical for every check the cap2UI5 host can run, the windowed +tables included ([below](#differences-between-the-two-backends)). ## The move from 1.148.0 to 1.149.0 @@ -155,6 +160,53 @@ drive the window requests through the adapter interface, which has no agent client; `semantic.recorded-snapshots` replays the start and the `@BINDING_CALL` against the recording. +## Tables behind a data reference + +[Open question 14](../spec/open-questions.md#14-tables-behind-a-data-reference-in-the-backend-suite), +resolved (b): a table bound through a data reference is the model node +`//*`, and a backend MUST read its `__delta` there +([../spec/request.md](../spec/request.md#the-model-delta)). The +conformance app REF (`Z2UI5_CL_CONF_REF`) binds `MR_TAB` with `_bind( )` +and `MR_WIN` with `window_bind_tab( )` in its own order (`QTY` +descending); the two checks send `{ "MR_TAB": { "*": { "__delta": { "1": +{ "TEXT": "zwei", "DONE": true } } } } }` and `{ "MR_WIN": { "*": { +"__delta": { "0": { "DONE": true }, "2": { "DONE": true } } } } }` with +`CHECK`. Measured 2026-11-19: + +| Backend | `model.reference-delta` | `window.delta-positions-reference` | +|---|---|---| +| `node-runtime` 1.149.0 | pass - exactly row 2 changed, `SUMMARY` `1:one:,2:zwei:X,3:three:;` | pass - positions 0 and 2 land in the rows with `ID` 4 and 5, `SUMMARY` `...;4,5` | +| `cap2ui5` 0.6.0 | **fail, pinned** - the start answers `500` | **fail, pinned** - the same | +| `cap2ui5` with `t.ref( )` (cap2UI5/cap2UI5 `5085ddc`, branch `claude/great-mendel-aiaiwu`, not released) | pass | pass | + +*node-runtime.* The spec recorded as an implementation note that the +1.149.0 backend applies the `*`/`__delta`, and that only the 1.149.0 +frontend sent it wrong (the whole attribute, [Frontend suite](#frontend-suite), finding 3 +of the UI5 SPA; fixed in abap2UI5 2cc0344, #3026). Verified against the +runtime the suite uses, `@abap2ui5/node-runtime` 1.149.0: [MOD] +`main_json_to_attri` reads every entry at the attribute's client name, +`/MR_TAB/*`, applies a `__delta` there by row and maps a windowed one +through its order (`delta_apply_to_table` with the window). No pin. + +*cap2UI5.* A JavaScript app of `@cap2ui5/cds-plugin` 0.6.0 declares its +fields as strings, numbers, booleans, structures and tables - there is no +field `TYPE REF TO data`, and a box the app made itself would neither bind +dereferenced nor survive the draft. The twin +[`apps/cap2ui5/ref.js`](apps/cap2ui5/ref.js) therefore needs `t.ref( )`: +on a plugin without it the app is registered as one whose `main( )` throws +(a declaration with `t.ref( )` would throw while the module loads and take +every app of the host with it), so the start of `Z2UI5_CL_CONF_REF` is +answered `500` and both checks end on that first request. *Filed for +cap2UI5:* `t.ref( )` - a field `TYPE REF TO data`, read and written as the +data it points to, bound as `"mr_tab->*"` with `_bind( )` and +`window_bind_tab( )`, kept in the draft by the framework's own S-RTTI - +on cap2UI5/cap2UI5 branch `claude/great-mendel-aiaiwu` (`5085ddc`). With that plugin +in the host (its `lib/define-app.js` over the installed 0.6.0, measured, +not recorded) the twin passes both checks and answers them byte for byte +as the ABAP app; the suite ends 92 pass, 1 warn (`error.details`). Once a +release carries it, the host moves to it, the two pins and +`BACKEND_TRAFFIC_APART` go, and the traffic is recorded again. + ## The move from 1.146.0 to 1.148.0 Until 2026-11-15 both hosts ran abap2UI5 1.146.0 (`@abap2ui5/node-runtime` @@ -240,7 +292,10 @@ both). `test/traffic.test.mjs` compares the two recordings check by check - status, media type and JSON body, draft ids normalized - and finds them **identical** apart from the following - the thirteen checks of the -[windowed tables](#windowed-tables) included. Both are the same framework +[windowed tables](#windowed-tables) included. The two checks of the app +REF are left out of the comparison (`BACKEND_TRAFFIC_APART` in +`test/lib/expected.mjs`): the cap2UI5 host does not get past its start +([below](#tables-behind-a-data-reference)). Both are the same framework (cap2UI5 hosts `@abap2ui5/node-runtime` rather than porting it), so this was the expected outcome; what differs is what the host adds around it. diff --git a/conformance/apps/README.md b/conformance/apps/README.md index 2548e29..84fae50 100644 --- a/conformance/apps/README.md +++ b/conformance/apps/README.md @@ -146,3 +146,17 @@ shows that they do not reach the app. | `FILTER` | the app's filter: `NAME` `Contains` argument 1; no argument clears it. As `SORT` (wired: `FILTER` with `'1'`) | | `RERENDER` | displays MAIN again, the sort and the filter passed unchanged | | Buttons `Sort list`, `Filter list` | wired frontend actions, no roundtrip of their own: `BINDING_CALL` `rows` `items` `sort` `QTY` `X`, and `rows` `items` `filter` `NAME` `Contains` `1` - the list binding of the UI5 frontend turns each into a window request | + +## Z2UI5_CL_CONF_REF + +Tables behind a data reference ([../../spec/request.md](../../spec/request.md#the-model-delta)). +Two attributes `TYPE REF TO data`, bound dereferenced - in ABAP +`_bind( )` of the data `mr_tab->*` points to, in cap2UI5 +`t.ref( )` fields bound as `"mr_tab->*"` - so each table is the model node +`//*`. + +| | | +|---|---| +| Model (initial) | `MR_TAB` { `*`: [{ `ID` 1, `TEXT` "one", `DONE` false }, { 2, "two", false }, { 3, "three", false }] } (bound with `_bind( )`); `MR_WIN` { `*`: six rows `{ ID, QTY, DONE }` } bound with `window_bind_tab( )`, a window of 4 and the app's sort `QTY` descending: `ID` 1 to 6, `QTY` = `ID` * 5 mod 7 (5 3 1 6 4 2), `DONE` false - so the model carries the rows with the `ID` 4 1 5 2 and `__WINDOW` = { `MR_WIN`: { `*`: { `TOTAL` 6, `COUNT` 4, `SIZE` 4 } } }; `SUMMARY` "" | +| View | Text `{/SUMMARY}`, a button `CHECK`; a Table over `{/MR_TAB/*}` with `{ID}`, an Input `{TEXT}` and a CheckBox `{DONE}` per row; a growing Table `rows` (`growingThreshold` 4) over `{/MR_WIN/*}` with `{ID}`, `{QTY}` and a CheckBox `{DONE}` | +| `CHECK` | `SUMMARY` = the rows of `MR_TAB` as `ID:TEXT:DONE` (`DONE` as `X` or empty) joined with `,`, then `;`, then the `ID` of the rows of `MR_WIN` that are `DONE`, in the order of the table, joined with `,` - initially `1:one:,2:two:,3:three:;` | diff --git a/conformance/apps/abap/z2ui5_cl_conf_ref.clas.abap b/conformance/apps/abap/z2ui5_cl_conf_ref.clas.abap new file mode 100644 index 0000000..5868182 --- /dev/null +++ b/conformance/apps/abap/z2ui5_cl_conf_ref.clas.abap @@ -0,0 +1,179 @@ +" Conformance app REF - tables behind a data reference: two attributes +" TYPE REF TO data, bound dereferenced, so the model nodes are /MR_TAB/* +" and /MR_WIN/*. MR_TAB is bound with _bind( ), MR_WIN with +" window_bind_tab( ) in a fixed order (QTY descending). CHECK writes what +" the backend holds into SUMMARY, so a client can see which edits arrived. +" Behaviour: conformance/apps/README.md, section REF. +CLASS z2ui5_cl_conf_ref DEFINITION PUBLIC FINAL CREATE PUBLIC. + + PUBLIC SECTION. + INTERFACES z2ui5_if_app. + + TYPES: + BEGIN OF ty_s_item, + id TYPE i, + text TYPE string, + done TYPE abap_bool, + END OF ty_s_item. + TYPES ty_t_item TYPE STANDARD TABLE OF ty_s_item WITH EMPTY KEY. + TYPES: + BEGIN OF ty_s_row, + id TYPE i, + qty TYPE i, + done TYPE abap_bool, + END OF ty_s_row. + TYPES ty_t_row TYPE STANDARD TABLE OF ty_s_row WITH EMPTY KEY. + + DATA mr_tab TYPE REF TO data. + DATA mr_win TYPE REF TO data. + DATA summary TYPE string. + + PROTECTED SECTION. + DATA client TYPE REF TO z2ui5_if_client. + + METHODS view_display. + METHODS summary_build. + METHODS model_init. + + PRIVATE SECTION. +ENDCLASS. + + +CLASS z2ui5_cl_conf_ref IMPLEMENTATION. + + METHOD z2ui5_if_app~main. + + me->client = client. + IF client->check_on_init( ). + model_init( ). + view_display( ). + ELSEIF client->check_on_navigated( ). + view_display( ). + ELSEIF client->check_on_event( ) AND client->get_event( ) = `CHECK`. + summary_build( ). + ENDIF. + + ENDMETHOD. + + METHOD view_display. + + FIELD-SYMBOLS TYPE ty_t_item. + FIELD-SYMBOLS TYPE ty_t_row. + + ASSIGN mr_tab->* TO . + ASSIGN mr_win->* TO . + + DATA(view) = z2ui5_cl_ui5_view_builder=>factory( + )->ele( n = `View` ns = `mvc` + )->a( n = `xmlns` v = `sap.m` + )->a( n = `xmlns:mvc` v = `sap.ui.core.mvc` ). + + DATA(page) = view->ele( `Page` + )->a( n = `title` v = `conformance - ref` ). + + page->tag( `Text` + )->a( n = `id` v = `summary` + )->a( n = `text` v = client->_bind( summary ) + )->tag( `Button` + )->a( n = `text` v = `Check` + )->a( n = `press` v = client->_event( `CHECK` ) ). + + page->ele( `Table` + )->a( n = `id` v = `items` + )->a( n = `items` v = client->_bind( ) + + )->ele( `columns` + + )->tag( `Column` + )->tag( `Column` + )->tag( `Column` + + )->end( + )->ele( `items` + )->ele( `ColumnListItem` + )->ele( `cells` + + )->tag( `Text` + )->a( n = `text` v = `{ID}` + )->tag( `Input` + )->a( n = `value` v = `{TEXT}` + )->tag( `CheckBox` + )->a( n = `selected` v = `{DONE}` ). + + page->ele( `Table` + )->a( n = `id` v = `rows` + )->a( n = `growing` v = `true` + )->a( n = `growingThreshold` v = `4` + )->a( n = `items` v = client->window_bind_tab( + val = + window = 4 + t_sort = VALUE #( ( path = `QTY` descending = abap_true ) ) ) + + )->ele( `columns` + + )->tag( `Column` + )->tag( `Column` + )->tag( `Column` + + )->end( + )->ele( `items` + )->ele( `ColumnListItem` + )->ele( `cells` + + )->tag( `Text` + )->a( n = `text` v = `{ID}` + )->tag( `Text` + )->a( n = `text` v = `{QTY}` + )->tag( `CheckBox` + )->a( n = `selected` v = `{DONE}` ). + + client->view_display( view->stringify( ) ). + + ENDMETHOD. + + METHOD summary_build. + + FIELD-SYMBOLS TYPE ty_t_item. + FIELD-SYMBOLS TYPE ty_t_row. + DATA lt_rows TYPE string_table. + DATA lt_done TYPE string_table. + + ASSIGN mr_tab->* TO . + ASSIGN mr_win->* TO . + + LOOP AT INTO DATA(ls_item). + INSERT |{ ls_item-id }:{ ls_item-text }:{ ls_item-done }| INTO TABLE lt_rows. + ENDLOOP. + LOOP AT INTO DATA(ls_row) WHERE done = abap_true. + INSERT |{ ls_row-id }| INTO TABLE lt_done. + ENDLOOP. + + summary = concat_lines_of( table = lt_rows + sep = `,` ) && `;` && + concat_lines_of( table = lt_done + sep = `,` ). + + ENDMETHOD. + + METHOD model_init. + + FIELD-SYMBOLS TYPE ty_t_item. + FIELD-SYMBOLS TYPE ty_t_row. + + CREATE DATA mr_tab TYPE ty_t_item. + ASSIGN mr_tab->* TO . + = VALUE #( ( id = 1 text = `one` ) + ( id = 2 text = `two` ) + ( id = 3 text = `three` ) ). + + " QTY runs in another order than ID: 5 3 1 6 4 2 + CREATE DATA mr_win TYPE ty_t_row. + ASSIGN mr_win->* TO . + DO 6 TIMES. + INSERT VALUE #( id = sy-index + qty = ( sy-index * 5 ) MOD 7 ) INTO TABLE . + ENDDO. + + ENDMETHOD. + +ENDCLASS. diff --git a/conformance/apps/abap/z2ui5_cl_conf_ref.clas.xml b/conformance/apps/abap/z2ui5_cl_conf_ref.clas.xml new file mode 100644 index 0000000..024c7a2 --- /dev/null +++ b/conformance/apps/abap/z2ui5_cl_conf_ref.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_CL_CONF_REF + E + protocol conformance - data references + 1 + X + X + X + + + + diff --git a/conformance/apps/cap2ui5/ref.js b/conformance/apps/cap2ui5/ref.js new file mode 100644 index 0000000..72eaab5 --- /dev/null +++ b/conformance/apps/cap2ui5/ref.js @@ -0,0 +1,64 @@ +// Conformance app REF - the cap2UI5 equivalent of +// conformance/apps/abap/z2ui5_cl_conf_ref.clas.abap. +// Behaviour: conformance/apps/README.md, section REF. +// t.ref( ) - a field TYPE REF TO data, bound dereferenced as "mr_tab->*" - +// comes after @cap2ui5/cds-plugin 0.6.0. On a plugin without it the app is +// registered all the same and its start fails, naming why - a declaration +// with t.ref( ) would throw while the module loads, and take every other +// app of the host with it. +const { defineApp, t } = require("@cap2ui5/cds-plugin"); + +const NO_REF = "Z2UI5_CL_CONF_REF: this @cap2ui5/cds-plugin has no t.ref( ) - a field TYPE REF TO data needs a later one"; + +class NoRef { + main() { + throw new Error(NO_REF); + } +} + +defineApp("Z2UI5_CL_CONF_REF", typeof t.ref !== "function" ? NoRef : class { + mr_tab = t.ref(t.table({ id: 0, text: "", done: false })); + mr_win = t.ref(t.table({ id: 0, qty: 0, done: false })); + summary = ""; + + main(client) { + if (client.check_on_init()) { + this.model_init(); + this.view_display(client); + } else if (client.check_on_navigated()) { + this.view_display(client); + } else if (client.check_on_event() && client.get_event() === "CHECK") { + this.summary_build(); + } + } + + view_display(client) { + client.view_display( + `` + + `` + + `` + + `