Repository navigation
Add 5 new samples: CustomData, event arguments, wizard transitions - #10
Merged
Merged
Conversation
samples.test.mjs and the consumer test take the samples from the directory, the differential test from scripts/samples.json. A module that is in the directory but not in the file - left behind when a sample is dropped from the list, or written by hand without an entry - is therefore packed, served and started like any other, and never held to its ABAP original. generate (and its --check, the CI gate) now names such a module and exits 1, as it already does for a sample listed as generated and handwritten at once. Two error paths say what is wrong instead of failing on the read: a listed sample the checkout at the pin does not have (a mistyped name) is reported as missing and counted as a failure rather than ending the run with ENOENT, and originals.mjs says how to clone the checkout when there is none, as generate.mjs does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVQ3JnU7R1QFQVgSoMK9RE
…originals The pin was six commits behind abap2UI5/samples' main. Of the 71 samples here, two originals changed since: Z2UI5_CL_SMP_APP_173 was reworked into a metadata-driven table and form (template:with, a nested template:repeat, template:if/elseif/else) and is translated again by abap2js, as before. Z2UI5_CL_SMP_APP_176 gained a button that changes the layout table and re-renders only the nested view - through ASSIGN mt_layout[ fname = `AGE` ] TO FIELD-SYMBOL( ), which abap2js refuses - so it moves to the handwritten list and follows its original's diff by hand, written as abap2js would write it: the row is read as a copy and written back whole, as Z2UI5_CL_SMP_APP_011 does for its LOOP ... REFERENCE INTO. Both pass the differential test against their transpiled originals: 71 samples, now 240 roundtrips (the new TOGGLE_AGE event), no difference. The README's status and table follow - abap2UI5/samples has 138 samples at this commit; the nine new ones (531 to 539) are not translated here yet. abap2js translates 533 to 537 of them and refuses 531, 532, 538 and 539. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVQ3JnU7R1QFQVgSoMK9RE
The repository ships no lockfile on purpose - test.yml says so: the run tests what an install gets today, as cap2UI5 and cap2UI5/samples-stack do. But every `npm install` writes one, and it then sits in `git status` as an untracked file waiting to be committed by mistake. samples-stack ignores it already; this does the same. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVQ3JnU7R1QFQVgSoMK9RE
abap2UI5/samples added nine samples between the old pin and 2e998ef. abap2js translates five of them as they are, so they come in the generated way - listed in samples.json, written by `npm run generate`, held to their originals by the differential test (76 samples, 260 roundtrips, no difference): 535 colours controls by their data with CustomData writeToDom, 536 attaches custom data to controls and reads it back on an event, 537 shows what an event argument can compute in the browser, and two are helper apps of samples abap2js refuses - 533, the wizard with page transitions that 531 calls, and 534, the popup-as-app that 532 calls. Like 469 and 489, the helpers are listed with the app that calls them. 534 shows a dialog and no view of its own, so the start test lists it with 186 as a sample that displays no MAIN view - in ABAP as here. The other four wait for abap2js: 531 reads a constant of another class, 532 uses NEW outside the navigation, 538 VALUE #( OPTIONAL ), 539 SPLIT. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVQ3JnU7R1QFQVgSoMK9RE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds five new sample applications demonstrating advanced UI5 features: CustomData with writeToDom for CSS styling and test anchors, custom data attached to controls, event argument expressions and formatters, wizard page transitions, and popup-as-app dialogs. Also updates two existing samples with enhanced metadata-driven templating and nested view re-rendering.
Key Changes
New Samples:
core:CustomDatawithwriteToDom="true"to write bound values as HTML data-* attributes for CSS styling and stable test selectorsapp:namespace shortcut and read them back withdata()in event handlersview_display(transition_back = true)to reverse animations when going backwardUpdated Samples:
template:with, nestedtemplate:repeat, andtemplate:if/elseif/elsefor dynamic form generation from a field cataloguenest_view_display()while keeping the main view on screen; moved to handwritten samples due to ASSIGN/FIELD-SYMBOL limitations in abap2jsInfrastructure:
2e998ef(2026-09-30)Notable Implementation Details
writeToDomrequires expanded notation (core:CustomDataelements) rather than theapp:key="value"shortcut to reach the DOM$or{prefix; results arrive as strings in ABAP (numbers as digits, booleans as "X" or empty)nest_view_display()only updates the nested content, leaving the main view and page state unchangedtransition: this.client.cs_transition.slideandtransition_backflag to control animation directionhttps://claude.ai/code/session_01NVQ3JnU7R1QFQVgSoMK9RE