Skip to content

Commit f7c5e27

Browse files
oblomov-devclaude
andauthored
Add framework - new (beta) package (00/08) with feature samples + Message - MessageView (#683)
* Add framework - new (beta) package with four feature samples New subpackage src/01/07 "framework - new (beta)" for the newest framework features, collecting one minimal sample per change made in the current round so each can be followed on its own: - 448 Control Call - Panel setExpanded: toggles a panel via the newly whitelisted setExpanded method (control_call_by_id), client-side. - 449 Control Call - PDFViewer open: opens a popup-mode PDFViewer kept as a page dependent via the newly whitelisted open method. - 450 Formatter - weightState via core:require: wires the curated formatter module (z2ui5/model/formatter) into the view with core:require and binds ObjectNumber state to Formatter.weightState (z2ui5.Util is deprecated in favor of this module). - 451 Custom Control - MultiInput Validator: installs the free-text -> token validator via the bundled z2ui5.cc.MultiInputExt companion. AGENTS.md §1 tree extended with the new subpackage (check-agents passes) and the sample_app_001 overview catalog regenerated (new group inserted at its numeric slot, between use cases and the demo kit rebuilds). abaplint: 0 issues. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ToSg1mGiCVLAoVpJL6wdZh * Add framework - basics sample: Message - MessageView Copy the MessageView demo (app 038) into src/01/01 as app 452 with the description "Message - MessageView", joining the existing Message samples (Backend / MessageBox / MessageToast) in the framework basics group. The demo kit rebuild header is dropped since the copy is a framework feature sample, not a 1:1 rebuild (those stay in 01/08); the original 038 remains under controls - sap.m unchanged. Shows that sap.m.MessageView / MessageItem / MessagePopover work in abap2UI5 with the typed builders over a plain bound ABAP table - no MessageManager or message> model needed. Overview catalog regenerated; abaplint 0 issues; agents-structure clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ToSg1mGiCVLAoVpJL6wdZh * Move framework - new (beta) package from src/01/07 to src/00/08 These samples exercise framework features that are not yet in a stable release (the open/setExpanded control_call_by_id whitelist entries and the curated formatter module), so they must not sit in src/01 ("basic", which survives every build and is expected to run against the released framework). src/00 ("extended") is stripped from the ABAP_CLOUD and ABAP_702 builds and only checked by ABAP_STANDARD - the correct home for beta-feature demos. - git mv src/01/07 -> src/00/08 (FOLDER_LOGIC=PREFIX: no class rename; apps 448-451 keep their names). - AGENTS.md: §1 tree moves the subpackage under 00 (after 07 experimental, before 99 obsolete) and §2 adds decision rule 8 "needs framework features not yet in a stable release (beta) -> 00/08". - Overview catalogs regenerated: the tile group moves from sample_app_001 (basic) to sample_app_000 (extended) at its numeric slot. - App 452 (Message - MessageView) stays in src/01/01 - it is a released feature, not beta. check-agents clean; abaplint 0 issues. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ToSg1mGiCVLAoVpJL6wdZh --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent fc17ac4 commit f7c5e27

14 files changed

Lines changed: 658 additions & 1 deletion

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ src/
5454
├── 05/ only with javascript and css and html needs native JS / CSS / HTML
5555
├── 06/ only testing test / scaffolding apps, not demos
5656
├── 07/ experimental, TODO work-in-progress / not finished
57+
├── 08/ framework - new (beta) needs framework features not yet in a stable release
5758
└── 99/ obsolete superseded, or built on a deprecated UI5 control
5859
```
5960

@@ -120,7 +121,8 @@ The split is driven directly by the CI builds:
120121
5. Needs native JavaScript / CSS / HTML → `00/05`
121122
6. Test / scaffolding app → `00/06`
122123
7. Experimental / work-in-progress → `00/07`
123-
8. Deprecated control/property, or superseded → `00/99`
124+
8. Needs framework features not yet in a stable release (beta) → `00/08`
125+
9. Deprecated control/property, or superseded → `00/99`
124126

125127
A sample qualifies for `src/01` **only if none** of the above restrictions
126128
apply: OpenUI5-compatible, ABAP-Cloud-ready, standalone, every control **and**

src/00/08/package.devc.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DEVC" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<DEVC>
6+
<CTEXT>framework - new (beta)</CTEXT>
7+
<SRV_CHECK>X</SRV_CHECK>
8+
</DEVC>
9+
</asx:values>
10+
</asx:abap>
11+
</abapGit>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
CLASS z2ui5_cl_demo_app_448 DEFINITION PUBLIC.
2+
3+
PUBLIC SECTION.
4+
INTERFACES z2ui5_if_app.
5+
6+
PROTECTED SECTION.
7+
DATA client TYPE REF TO z2ui5_if_client.
8+
" not bound - mirrors the panel state so the toggle can invert it
9+
DATA expanded TYPE abap_bool.
10+
11+
METHODS view_display.
12+
METHODS on_event.
13+
14+
PRIVATE SECTION.
15+
ENDCLASS.
16+
17+
18+
CLASS z2ui5_cl_demo_app_448 IMPLEMENTATION.
19+
20+
METHOD z2ui5_if_app~main.
21+
22+
me->client = client.
23+
IF client->check_on_init( ).
24+
view_display( ).
25+
ELSE.
26+
on_event( ).
27+
ENDIF.
28+
29+
ENDMETHOD.
30+
31+
32+
METHOD on_event.
33+
34+
CASE client->get( )-event.
35+
36+
WHEN `TOGGLE`.
37+
" invert the mirrored state and call the whitelisted setExpanded on
38+
" the panel - client-side, after the response renders, no rebuild
39+
expanded = xsdbool( expanded = abap_false ).
40+
client->control_call_by_id( id = `demoPanel`
41+
method = `setExpanded`
42+
params = VALUE #( ( CONV string( expanded ) ) ) ).
43+
44+
ENDCASE.
45+
46+
ENDMETHOD.
47+
48+
49+
METHOD view_display.
50+
51+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
52+
53+
DATA(page) = view->shell(
54+
)->page(
55+
title = `abap2UI5 - Action - control_call_by_id setExpanded`
56+
navbuttonpress = client->_event_nav_app_leave( )
57+
shownavbutton = client->check_app_prev_stack( ) ).
58+
59+
page->message_strip(
60+
text = `The button toggles the panel via the whitelisted setExpanded method ` &&
61+
`(control_call_by_id), client-side after render - no view rebuild.`
62+
type = `Information`
63+
showicon = abap_true
64+
class = `sapUiSmallMargin` ).
65+
66+
page->vbox( `sapUiSmallMargin`
67+
)->button( text = `Toggle panel`
68+
icon = `sap-icon://expand-group`
69+
press = client->_event( `TOGGLE` ) ).
70+
71+
page->panel( id = `demoPanel`
72+
headertext = `Collapsible panel`
73+
expandable = abap_true
74+
width = `auto`
75+
class = `sapUiSmallMargin`
76+
)->text( `Content of the panel - collapsed and expanded from the backend without a roundtrip payload.` ).
77+
78+
client->view_display( view->stringify( ) ).
79+
80+
ENDMETHOD.
81+
82+
ENDCLASS.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>Z2UI5_CL_DEMO_APP_448</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Control Call - Panel setExpanded</DESCRIPT>
9+
<STATE>1</STATE>
10+
<CLSCCINCL>X</CLSCCINCL>
11+
<FIXPT>X</FIXPT>
12+
<UNICODE>X</UNICODE>
13+
</VSEOCLASS>
14+
</asx:values>
15+
</asx:abap>
16+
</abapGit>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
CLASS z2ui5_cl_demo_app_449 DEFINITION PUBLIC.
2+
3+
PUBLIC SECTION.
4+
INTERFACES z2ui5_if_app.
5+
6+
PROTECTED SECTION.
7+
DATA client TYPE REF TO z2ui5_if_client.
8+
9+
METHODS view_display.
10+
METHODS on_event.
11+
12+
PRIVATE SECTION.
13+
ENDCLASS.
14+
15+
16+
CLASS z2ui5_cl_demo_app_449 IMPLEMENTATION.
17+
18+
METHOD z2ui5_if_app~main.
19+
20+
me->client = client.
21+
IF client->check_on_init( ).
22+
view_display( ).
23+
ELSE.
24+
on_event( ).
25+
ENDIF.
26+
27+
ENDMETHOD.
28+
29+
30+
METHOD on_event.
31+
32+
CASE client->get( )-event.
33+
34+
WHEN `OPEN`.
35+
" open the popup-mode PDFViewer via the whitelisted open method -
36+
" the viewer brings its own dialog and close button
37+
client->control_call_by_id( id = `demoPdf`
38+
method = `open` ).
39+
40+
ENDCASE.
41+
42+
ENDMETHOD.
43+
44+
45+
METHOD view_display.
46+
47+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
48+
49+
DATA(page) = view->shell(
50+
)->page(
51+
title = `abap2UI5 - Action - control_call_by_id open`
52+
navbuttonpress = client->_event_nav_app_leave( )
53+
shownavbutton = client->check_app_prev_stack( ) ).
54+
55+
" a popup-mode PDFViewer kept as a dependent of the page; opened
56+
" imperatively from the backend, like a controller calling oViewer.open()
57+
page->dependents(
58+
)->_generic( name = `PDFViewer`
59+
t_prop = VALUE #( ( n = `id` v = `demoPdf` )
60+
( n = `title` v = `Sample PDF` )
61+
( n = `source` v = `https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/sample/PDFViewerPopup/sample1.pdf` )
62+
( n = `height` v = `100%` ) ) ).
63+
64+
page->message_strip(
65+
text = `The button opens the popup-mode PDFViewer via the whitelisted open method ` &&
66+
`(control_call_by_id), client-side after render.`
67+
type = `Information`
68+
showicon = abap_true
69+
class = `sapUiSmallMargin` ).
70+
71+
page->vbox( `sapUiSmallMargin`
72+
)->button( text = `Open PDF`
73+
icon = `sap-icon://pdf-attachment`
74+
press = client->_event( `OPEN` ) ).
75+
76+
client->view_display( view->stringify( ) ).
77+
78+
ENDMETHOD.
79+
80+
ENDCLASS.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>Z2UI5_CL_DEMO_APP_449</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Control Call - PDFViewer open</DESCRIPT>
9+
<STATE>1</STATE>
10+
<CLSCCINCL>X</CLSCCINCL>
11+
<FIXPT>X</FIXPT>
12+
<UNICODE>X</UNICODE>
13+
</VSEOCLASS>
14+
</asx:values>
15+
</asx:abap>
16+
</abapGit>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
CLASS z2ui5_cl_demo_app_450 DEFINITION PUBLIC.
2+
3+
PUBLIC SECTION.
4+
INTERFACES z2ui5_if_app.
5+
6+
TYPES:
7+
BEGIN OF ty_s_product,
8+
name TYPE string,
9+
measure TYPE string,
10+
unit TYPE string,
11+
END OF ty_s_product.
12+
DATA t_products TYPE STANDARD TABLE OF ty_s_product WITH EMPTY KEY.
13+
14+
PROTECTED SECTION.
15+
DATA client TYPE REF TO z2ui5_if_client.
16+
17+
METHODS view_display.
18+
19+
PRIVATE SECTION.
20+
ENDCLASS.
21+
22+
23+
CLASS z2ui5_cl_demo_app_450 IMPLEMENTATION.
24+
25+
METHOD z2ui5_if_app~main.
26+
27+
me->client = client.
28+
IF client->check_on_init( ).
29+
t_products = VALUE #(
30+
( name = `Comfort Easy` measure = `0.2` unit = `KG` )
31+
( name = `Notebook Basic 15` measure = `4.2` unit = `KG` )
32+
( name = `Ergo Screen E-I` measure = `21` unit = `KG` ) ).
33+
view_display( ).
34+
ENDIF.
35+
36+
ENDMETHOD.
37+
38+
39+
METHOD view_display.
40+
41+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
42+
43+
" require the framework's curated formatter module into the view, like an
44+
" original UI5 app requires its model/formatter - the weightState function
45+
" (weight -> ValueState) then works as a plain formatter in the binding.
46+
" z2ui5.Util is deprecated; z2ui5/model/formatter is the module to use.
47+
view->_generic_property( VALUE #( n = `core:require`
48+
v = `{Formatter: 'z2ui5/model/formatter'}` ) ).
49+
50+
DATA(page) = view->shell(
51+
)->page(
52+
title = `abap2UI5 - Formatter - weightState via core:require`
53+
navbuttonpress = client->_event_nav_app_leave( )
54+
shownavbutton = client->check_app_prev_stack( ) ).
55+
56+
page->message_strip(
57+
text = `The Weight column's state is formatted client-side by ` &&
58+
`Formatter.weightState from z2ui5/model/formatter, wired via core:require.`
59+
type = `Information`
60+
showicon = abap_true
61+
class = `sapUiSmallMargin` ).
62+
63+
DATA(tab) = page->table( id = `productTable`
64+
items = client->_bind( t_products ) ).
65+
66+
tab->columns(
67+
)->column( )->text( `Product` )->get_parent(
68+
)->column( )->text( `Weight` )->get_parent( ).
69+
70+
tab->items(
71+
)->column_list_item(
72+
)->cells(
73+
)->text( `{NAME}`
74+
)->object_number(
75+
number = `{MEASURE}`
76+
unit = `{UNIT}`
77+
state = |\{ parts: [\{path: 'MEASURE'\}, \{path: 'UNIT'\}], formatter: 'Formatter.weightState' \}| ).
78+
79+
client->view_display( view->stringify( ) ).
80+
81+
ENDMETHOD.
82+
83+
ENDCLASS.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>Z2UI5_CL_DEMO_APP_450</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Formatter - weightState via core require</DESCRIPT>
9+
<STATE>1</STATE>
10+
<CLSCCINCL>X</CLSCCINCL>
11+
<FIXPT>X</FIXPT>
12+
<UNICODE>X</UNICODE>
13+
</VSEOCLASS>
14+
</asx:values>
15+
</asx:abap>
16+
</abapGit>

0 commit comments

Comments
 (0)