Skip to content

Commit 6635f66

Browse files
add warning if ICF-nodes are inactive (#563)
1 parent e1f66c0 commit 6635f66

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/00/z2ui5_cl_demo_app_s_03.clas.abap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ CLASS z2ui5_cl_demo_app_s_03 IMPLEMENTATION.
4040

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

43+
SELECT
44+
SINGLE FROM icfservloc
45+
FIELDS icfactive
46+
WHERE icf_name = 'MIME_DEMO'
47+
INTO @DATA(icfactive).
48+
4349
" Note, these are demo sounds and are part of the abap2UI5 sample repo.
4450
" They are NOT meant to use in production.
4551
view->_generic( name = `script`
@@ -48,6 +54,14 @@ CLASS z2ui5_cl_demo_app_s_03 IMPLEMENTATION.
4854
&& |function playError() \{ new Audio("/SAP/PUBLIC/BC/ABAP/mime_demo/z2ui5_demo_error.mp3").play(); \}| ).
4955

5056
DATA(vbox) = view->page( title = `Play success and error sounds` )->vbox( class = `sapUiSmallMargin` ).
57+
58+
IF icfactive = abap_false.
59+
vbox->message_strip(
60+
text = `ICF Service '/SAP/PUBLIC/BC/ABAP/mime_demo' is not active. Sounds will not play. Please activate the ICF service first.`
61+
type = `Warning`
62+
visible = abap_true ).
63+
ENDIF.
64+
5165
vbox->message_strip(
5266
text = client->_bind( message-text )
5367
type = client->_bind( message-type )

src/00/z2ui5_cl_demo_app_s_05.clas.abap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ CLASS z2ui5_cl_demo_app_s_05 IMPLEMENTATION.
7272

7373
METHOD z2ui5_on_render.
7474

75+
SELECT
76+
SINGLE FROM icfservloc
77+
FIELDS icfactive
78+
WHERE icf_name = 'Z2UI5_SAMPLE'
79+
INTO @DATA(icfactive).
80+
7581
DATA(view) = z2ui5_cl_xml_view=>factory( ).
7682
DATA(page) = view->shell(
7783
)->page(
@@ -85,6 +91,13 @@ CLASS z2ui5_cl_demo_app_s_05 IMPLEMENTATION.
8591
tooltip = `Sample information`
8692
press = client->_event( 'CLICK_HINT_ICON' ) ).
8793

94+
IF icfactive = abap_false.
95+
page->message_strip(
96+
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.`
97+
type = `Warning`
98+
visible = abap_true ).
99+
ENDIF.
100+
88101
DATA(form) = page->simple_form( editable = abap_true
89102
title = `Publish news`
90103
class = `sapUiTinyMarginBottom`

0 commit comments

Comments
 (0)