Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ src/
├── 05/ only with javascript and css and html needs native JS / CSS / HTML
├── 06/ only testing test / scaffolding apps, not demos
├── 07/ experimental, TODO work-in-progress / not finished
├── 08/ framework - new (beta) needs framework features not yet in a stable release
└── 99/ obsolete superseded, or built on a deprecated UI5 control
```

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

A sample qualifies for `src/01` **only if none** of the above restrictions
apply: OpenUI5-compatible, ABAP-Cloud-ready, standalone, every control **and**
Expand Down
11 changes: 11 additions & 0 deletions src/00/08/package.devc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DEVC" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<DEVC>
<CTEXT>framework - new (beta)</CTEXT>
<SRV_CHECK>X</SRV_CHECK>
</DEVC>
</asx:values>
</asx:abap>
</abapGit>
82 changes: 82 additions & 0 deletions src/00/08/z2ui5_cl_demo_app_448.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
CLASS z2ui5_cl_demo_app_448 DEFINITION PUBLIC.

PUBLIC SECTION.
INTERFACES z2ui5_if_app.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
" not bound - mirrors the panel state so the toggle can invert it
DATA expanded TYPE abap_bool.

METHODS view_display.
METHODS on_event.

PRIVATE SECTION.
ENDCLASS.


CLASS z2ui5_cl_demo_app_448 IMPLEMENTATION.

METHOD z2ui5_if_app~main.

me->client = client.
IF client->check_on_init( ).
view_display( ).
ELSE.
on_event( ).
ENDIF.

ENDMETHOD.


METHOD on_event.

CASE client->get( )-event.

WHEN `TOGGLE`.
" invert the mirrored state and call the whitelisted setExpanded on
" the panel - client-side, after the response renders, no rebuild
expanded = xsdbool( expanded = abap_false ).
client->control_call_by_id( id = `demoPanel`
method = `setExpanded`
params = VALUE #( ( CONV string( expanded ) ) ) ).

ENDCASE.

ENDMETHOD.


METHOD view_display.

DATA(view) = z2ui5_cl_xml_view=>factory( ).

DATA(page) = view->shell(
)->page(
title = `abap2UI5 - Action - control_call_by_id setExpanded`
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.`
type = `Information`
showicon = abap_true
class = `sapUiSmallMargin` ).

page->vbox( `sapUiSmallMargin`
)->button( text = `Toggle panel`
icon = `sap-icon://expand-group`
press = client->_event( `TOGGLE` ) ).

page->panel( id = `demoPanel`
headertext = `Collapsible panel`
expandable = abap_true
width = `auto`
class = `sapUiSmallMargin`
)->text( `Content of the panel - collapsed and expanded from the backend without a roundtrip payload.` ).

client->view_display( view->stringify( ) ).

ENDMETHOD.

ENDCLASS.
16 changes: 16 additions & 0 deletions src/00/08/z2ui5_cl_demo_app_448.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_448</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>Control Call - Panel setExpanded</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>
80 changes: 80 additions & 0 deletions src/00/08/z2ui5_cl_demo_app_449.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
CLASS z2ui5_cl_demo_app_449 DEFINITION PUBLIC.

PUBLIC SECTION.
INTERFACES z2ui5_if_app.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

METHODS view_display.
METHODS on_event.

PRIVATE SECTION.
ENDCLASS.


CLASS z2ui5_cl_demo_app_449 IMPLEMENTATION.

METHOD z2ui5_if_app~main.

me->client = client.
IF client->check_on_init( ).
view_display( ).
ELSE.
on_event( ).
ENDIF.

ENDMETHOD.


METHOD on_event.

CASE client->get( )-event.

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` ).

ENDCASE.

ENDMETHOD.


METHOD view_display.

DATA(view) = z2ui5_cl_xml_view=>factory( ).

DATA(page) = view->shell(
)->page(
title = `abap2UI5 - Action - control_call_by_id open`
navbuttonpress = client->_event_nav_app_leave( )
shownavbutton = client->check_app_prev_stack( ) ).

" a popup-mode PDFViewer kept as a dependent of the page; opened
" imperatively from the backend, like a controller calling oViewer.open()
page->dependents(
)->_generic( name = `PDFViewer`
t_prop = VALUE #( ( n = `id` v = `demoPdf` )
( n = `title` v = `Sample PDF` )
( n = `source` v = `https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/sample/PDFViewerPopup/sample1.pdf` )
( n = `height` v = `100%` ) ) ).

page->message_strip(
text = `The button opens the popup-mode PDFViewer via the whitelisted open method ` &&
`(control_call_by_id), client-side after render.`
type = `Information`
showicon = abap_true
class = `sapUiSmallMargin` ).

page->vbox( `sapUiSmallMargin`
)->button( text = `Open PDF`
icon = `sap-icon://pdf-attachment`
press = client->_event( `OPEN` ) ).

client->view_display( view->stringify( ) ).

ENDMETHOD.

ENDCLASS.
16 changes: 16 additions & 0 deletions src/00/08/z2ui5_cl_demo_app_449.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_449</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>Control Call - PDFViewer open</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>
83 changes: 83 additions & 0 deletions src/00/08/z2ui5_cl_demo_app_450.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
CLASS z2ui5_cl_demo_app_450 DEFINITION PUBLIC.

PUBLIC SECTION.
INTERFACES z2ui5_if_app.

TYPES:
BEGIN OF ty_s_product,
name TYPE string,
measure TYPE string,
unit TYPE string,
END OF ty_s_product.
DATA t_products TYPE STANDARD TABLE OF ty_s_product WITH EMPTY KEY.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

METHODS view_display.

PRIVATE SECTION.
ENDCLASS.


CLASS z2ui5_cl_demo_app_450 IMPLEMENTATION.

METHOD z2ui5_if_app~main.

me->client = client.
IF client->check_on_init( ).
t_products = VALUE #(
( name = `Comfort Easy` measure = `0.2` unit = `KG` )
( name = `Notebook Basic 15` measure = `4.2` unit = `KG` )
( name = `Ergo Screen E-I` measure = `21` unit = `KG` ) ).
view_display( ).
ENDIF.

ENDMETHOD.


METHOD view_display.

DATA(view) = z2ui5_cl_xml_view=>factory( ).

" require the framework's curated formatter module into the view, like an
" original UI5 app requires its model/formatter - the weightState function
" (weight -> ValueState) then works as a plain formatter in the binding.
" z2ui5.Util is deprecated; z2ui5/model/formatter is the module to use.
view->_generic_property( VALUE #( n = `core:require`
v = `{Formatter: 'z2ui5/model/formatter'}` ) ).

DATA(page) = view->shell(
)->page(
title = `abap2UI5 - Formatter - weightState via core:require`
navbuttonpress = client->_event_nav_app_leave( )
shownavbutton = client->check_app_prev_stack( ) ).

page->message_strip(
text = `The Weight column's state is formatted client-side by ` &&
`Formatter.weightState from z2ui5/model/formatter, wired via core:require.`
type = `Information`
showicon = abap_true
class = `sapUiSmallMargin` ).

DATA(tab) = page->table( id = `productTable`
items = client->_bind( t_products ) ).

tab->columns(
)->column( )->text( `Product` )->get_parent(
)->column( )->text( `Weight` )->get_parent( ).

tab->items(
)->column_list_item(
)->cells(
)->text( `{NAME}`
)->object_number(
number = `{MEASURE}`
unit = `{UNIT}`
state = |\{ parts: [\{path: 'MEASURE'\}, \{path: 'UNIT'\}], formatter: 'Formatter.weightState' \}| ).

client->view_display( view->stringify( ) ).

ENDMETHOD.

ENDCLASS.
16 changes: 16 additions & 0 deletions src/00/08/z2ui5_cl_demo_app_450.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_450</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>Formatter - weightState via core require</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>
Loading