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
14 changes: 14 additions & 0 deletions src/00/z2ui5_cl_demo_app_s_03.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ CLASS z2ui5_cl_demo_app_s_03 IMPLEMENTATION.

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

SELECT
SINGLE FROM icfservloc
FIELDS icfactive
WHERE icf_name = 'MIME_DEMO'
INTO @DATA(icfactive).

" Note, these are demo sounds and are part of the abap2UI5 sample repo.
" They are NOT meant to use in production.
view->_generic( name = `script`
Expand All @@ -48,6 +54,14 @@ CLASS z2ui5_cl_demo_app_s_03 IMPLEMENTATION.
&& |function playError() \{ new Audio("/SAP/PUBLIC/BC/ABAP/mime_demo/z2ui5_demo_error.mp3").play(); \}| ).

DATA(vbox) = view->page( title = `Play success and error sounds` )->vbox( class = `sapUiSmallMargin` ).

IF icfactive = abap_false.
vbox->message_strip(
text = `ICF Service '/SAP/PUBLIC/BC/ABAP/mime_demo' is not active. Sounds will not play. Please activate the ICF service first.`
type = `Warning`
visible = abap_true ).
ENDIF.

vbox->message_strip(
text = client->_bind( message-text )
type = client->_bind( message-type )
Expand Down
13 changes: 13 additions & 0 deletions src/00/z2ui5_cl_demo_app_s_05.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ CLASS z2ui5_cl_demo_app_s_05 IMPLEMENTATION.

METHOD z2ui5_on_render.

SELECT
SINGLE FROM icfservloc
FIELDS icfactive
WHERE icf_name = 'Z2UI5_SAMPLE'
INTO @DATA(icfactive).

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA(page) = view->shell(
)->page(
Expand All @@ -85,6 +91,13 @@ CLASS z2ui5_cl_demo_app_s_05 IMPLEMENTATION.
tooltip = `Sample information`
press = client->_event( 'CLICK_HINT_ICON' ) ).

IF icfactive = abap_false.
page->message_strip(
text = `ICF Service '/sap/bc/apc/sap/z2ui5_sample' is not active. WebSocket communication will not work. Please activate the ICF Service in transaction SICF.`
type = `Warning`
visible = abap_true ).
ENDIF.

DATA(form) = page->simple_form( editable = abap_true
title = `Publish news`
class = `sapUiTinyMarginBottom`
Expand Down