* custom controls

* bugfixes

* message manager

* abaplint fixes
This commit is contained in:
oblomov 2023-04-12 08:21:54 +02:00
parent f63c1fe5cf
commit 451630ef86
4 changed files with 210 additions and 2 deletions

View File

@ -95,9 +95,10 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION.
).
grid->simple_form( title = 'HowTo - Messages' layout = 'ResponsiveGridLayout' )->content( 'form'
)->button( text = 'Toast, Box & Strip' press = client->_event( 'z2ui5_cl_app_demo_08' )
)->button( text = 'Illustrated Message' press = client->_event( 'z2ui5_cl_app_demo_33' )
)->button( text = 'Toast, Box & Strip' press = client->_event( 'z2ui5_cl_app_demo_08' )
)->button( text = 'Illustrated Message' press = client->_event( 'z2ui5_cl_app_demo_33' )
)->button( text = 'T100 & bapiret popup' press = client->_event( 'z2ui5_cl_app_demo_34' )
)->button( text = 'Message Manager' press = client->_event( 'z2ui5_cl_app_demo_38' )
).
DATA(form) = page->grid( 'L9 M12 S12'

View File

@ -0,0 +1,131 @@
CLASS z2ui5_cl_app_demo_38 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
TYPES:
BEGIN OF ty_row,
title TYPE string,
value TYPE string,
descr TYPE string,
icon TYPE string,
info TYPE string,
checkbox TYPE abap_bool,
END OF ty_row.
TYPES:
BEGIN OF ty_msg,
type TYPE string,
title TYPE string,
subtitle TYPE string,
description TYPE string,
group TYPE string,
END OF ty_msg.
DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.
DATA t_msg TYPE STANDARD TABLE OF ty_msg WITH EMPTY KEY.
DATA check_initialized TYPE abap_bool.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
DATA:
BEGIN OF app,
check_initialized TYPE abap_bool,
view_main TYPE string,
view_popup TYPE string,
get TYPE z2ui5_if_client=>ty_s_get,
next TYPE z2ui5_if_client=>ty_s_next,
END OF app.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_app_demo_38 IMPLEMENTATION.
METHOD z2ui5_if_app~controller.
me->client = client.
"we collect all app infos in the structure app
app-get = client->get( ).
app-view_popup = ``. "we display popups only once so clear it after every roundtrip
IF check_initialized = abap_false.
check_initialized = abap_true.
t_msg = value #(
( description = 'descr' subtitle = 'subtitle' title = 'title' type = 'Error' group = 'group 01' )
( description = 'descr' subtitle = 'subtitle' title = 'title' type = 'Information' group = 'group 01' )
( description = 'descr' subtitle = 'subtitle' title = 'title' type = 'Information' group = 'group 02' )
( description = 'descr' subtitle = 'subtitle' title = 'title' type = 'Success' group = 'group 03' )
).
t_tab = VALUE #(
( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' )
( title = 'Peter' info = 'incompleted' descr = 'this is a description' icon = 'sap-icon://account' )
( title = 'Peter' info = 'working' descr = 'this is a description' icon = 'sap-icon://account' )
( title = 'Peter' info = 'working' descr = 'this is a description' icon = 'sap-icon://account' )
( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' )
( title = 'Peter' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' )
).
ENDIF.
CASE client->get( )-event.
WHEN 'MESSAGES'.
WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-id_prev_app_stack ) ).
ENDCASE.
DATA(page) = z2ui5_cl_xml_view_helper=>factory( )->shell(
)->page(
title = 'abap2UI5 - List'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = abap_true
)->header_content(
)->link(
text = 'Source_Code' target = '_blank'
href = z2ui5_cl_xml_view_helper=>hlp_get_source_code_url( app = me get = client->get( ) )
)->get_parent( ).
page->button( text = 'Messages' press = client->_event( 'MESSAGES' ) ).
page->message_view(
items = client->_bind( t_msg )
groupitems = abap_true
)->message_item(
type = `{TYPE}`
title = `{TITLE}`
subtitle = `{SUBTITLE}`
description = `{DESCRIPTION}`
groupname = `{GROUP}`
).
page->list(
headertext = 'List Ouput'
items = client->_bind_one( t_tab )
)->standard_list_item(
title = '{TITLE}'
description = '{DESCR}'
icon = '{ICON}'
info = '{INFO}' ).
app-next-xml_main = page->get_root( )->xml_get( ).
" data(popup) = z2ui5_cl_xml_view_helper=>factory_popup( )->
"set the data for the frontend
client->set_next( app-next ).
"the app will be serialized and persisted, we delete all data which is not needed in the future before
CLEAR app-get.
CLEAR app-next.
ENDMETHOD.
ENDCLASS.

View File

@ -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_APP_DEMO_38</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>messages - message manager</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -513,6 +513,30 @@ CLASS z2ui5_cl_xml_view_helper DEFINITION
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view_helper.
METHODS message_view
IMPORTING
items TYPE clike OPTIONAL
groupItems type clike optional
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view_helper.
METHODS message_popover
IMPORTING
items TYPE clike OPTIONAL
groupItems type clike optional
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view_helper.
METHODS message_item
IMPORTING
type TYPE clike OPTIONAL
title TYPE clike OPTIONAL
subtitle TYPE clike OPTIONAL
description TYPE clike OPTIONAL
groupName TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view_helper.
METHODS page
IMPORTING
title TYPE clike OPTIONAL
@ -2319,4 +2343,40 @@ CLASS z2ui5_cl_xml_view_helper IMPLEMENTATION.
ENDMETHOD.
METHOD message_item.
result = _generic(
name = `MessageItem`
t_prop = VALUE #(
( n = `type` v = type )
( n = `title` v = title )
( n = `subtitle` v = subtitle )
( n = `description` v = description )
( n = `groupName` v = groupName )
) ).
ENDMETHOD.
METHOD message_popover.
result = _generic(
name = `MessagePopover`
t_prop = VALUE #(
( n = `items` v = items )
( n = `groupItems` v = _=>get_json_boolean( groupItems ) )
) ).
ENDMETHOD.
METHOD message_view.
result = _generic(
name = `MessageView`
t_prop = VALUE #(
( n = `items` v = items )
( n = `groupItems` v = _=>get_json_boolean( groupItems ) )
) ).
ENDMETHOD.
ENDCLASS.