Skip to content

Commit 7c92a42

Browse files
Commit (#351)
1 parent d35d2f3 commit 7c92a42

File tree

3 files changed

+190
-0
lines changed

3 files changed

+190
-0
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
557557
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
558558
).
559559

560+
panel->generic_tile(
561+
header = 'InvisibleText'
562+
press = client->_event( 'Z2UI5_CL_DEMO_APP_282' )
563+
mode = 'LineMode'
564+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
565+
).
566+
560567

561568
panel = page->panel(
562569
expandable = abap_false
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
CLASS z2ui5_cl_demo_app_282 DEFINITION
2+
PUBLIC
3+
CREATE PUBLIC.
4+
5+
PUBLIC SECTION.
6+
7+
INTERFACES z2ui5_if_app.
8+
9+
DATA check_initialized TYPE abap_bool.
10+
11+
PROTECTED SECTION.
12+
13+
DATA client TYPE REF TO z2ui5_if_client.
14+
15+
METHODS display_view
16+
IMPORTING
17+
client TYPE REF TO z2ui5_if_client.
18+
METHODS on_event
19+
IMPORTING
20+
client TYPE REF TO z2ui5_if_client.
21+
METHODS z2ui5_display_popover
22+
IMPORTING
23+
id TYPE string.
24+
25+
PRIVATE SECTION.
26+
ENDCLASS.
27+
28+
29+
30+
CLASS z2ui5_cl_demo_app_282 IMPLEMENTATION.
31+
32+
33+
METHOD display_view.
34+
35+
DATA(page_01) = z2ui5_cl_xml_view=>factory( )->shell(
36+
)->page(
37+
title = `abap2UI5 - Sample: InvisibleText`
38+
navbuttonpress = client->_event( 'BACK' )
39+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
40+
41+
page_01->header_content(
42+
)->button( id = `button_hint_id`
43+
icon = `sap-icon://hint`
44+
tooltip = `Sample information`
45+
press = client->_event( 'CLICK_HINT_ICON' ) ).
46+
47+
page_01->header_content(
48+
)->link(
49+
text = 'UI5 Demo Kit'
50+
target = '_blank'
51+
href = 'https://sapui5.hana.ondemand.com/sdk/#/entity/sap.ui.core.InvisibleText/sample/sap.ui.core.sample.InvisibleText' ).
52+
53+
54+
page_01->_generic_property( VALUE #( n = `core:require` v = `{ MessageToast: 'sap/m/MessageToast' }` ) ).
55+
56+
DATA(page_02) = page_01->page(
57+
title = `Page`
58+
class = `sapUiContentPadding`
59+
)->custom_header(
60+
)->toolbar(
61+
)->button( type = `Back` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
62+
)->toolbar_spacer(
63+
)->title( text = `Title`
64+
)->toolbar_spacer(
65+
)->button( icon = `sap-icon://edit` press = `MessageToast.show( ${$source>/id} + ' Pressed' )` arialabelledby = `editButtonLabel` )->get_parent( )->get_parent(
66+
67+
)->sub_header(
68+
)->toolbar(
69+
)->toolbar_spacer(
70+
)->button( text = `Default` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
71+
)->button( type = `Reject` text = `Reject` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
72+
)->button( icon = `sap-icon://action` press = `MessageToast.show( ${$source>/id} + ' Pressed' )` arialabelledby = `actionButtonLabel`
73+
)->toolbar_spacer( )->get_parent( )->get_parent(
74+
75+
)->content(
76+
)->hbox(
77+
)->button( text = `Default`
78+
press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
79+
ariadescribedby = `defaultButtonDescription genericButtonDescription` )->get(
80+
)->layout_data(
81+
)->flex_item_data( growfactor = `1` )->get_parent( )->get_parent(
82+
)->button( type = `Accept`
83+
text = `Accept`
84+
press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
85+
ariadescribedby = `acceptButtonDescription genericButtonDescription` )->get(
86+
)->layout_data(
87+
)->flex_item_data( growfactor = `1` )->get_parent( )->get_parent(
88+
)->button( type = `Reject`
89+
text = `Reject`
90+
press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
91+
ariadescribedby = `rejectButtonDescription genericButtonDescription` )->get(
92+
)->layout_data(
93+
)->flex_item_data( growfactor = `1` )->get_parent( )->get_parent(
94+
)->button( text = `Coming Soon`
95+
press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
96+
ariadescribedby = `comingSoonButtonDescription genericButtonDescription`
97+
enabled = abap_false )->get(
98+
)->layout_data(
99+
)->flex_item_data( growfactor = `1` )->get_parent( )->get_parent( )->get_parent(
100+
101+
" Collection of labels (some of which are invisible) used to provide ARIA descriptions for the buttons
102+
)->label( id = `genericButtonDescription` text = `Note: The buttons in this sample display MessageToast when pressed.`
103+
104+
)->invisible_text( ns = `core` id = `defaultButtonDescription` text = `Description of default button goes here.` )->get_parent(
105+
)->invisible_text( ns = `core` id = `acceptButtonDescription` text = `Description of accept button goes here.` )->get_parent(
106+
)->invisible_text( ns = `core` id = `rejectButtonDescription` text = `Description of reject button goes here.` )->get_parent(
107+
)->invisible_text( ns = `core` id = `comingSoonButtonDescription` text = `This feature is not active just now.` )->get_parent(
108+
109+
" These labels exist only to provide targets for the ARIA label on the Edit and Action buttons
110+
)->invisible_text( ns = `core` id = `editButtonLabel` text = `Edit Button Label` )->get_parent(
111+
)->invisible_text( ns = `core` id = `actionButtonLabel` text = `Action Button Label` )->get_parent( )->get_parent(
112+
113+
)->footer(
114+
)->toolbar(
115+
)->toolbar_spacer(
116+
)->button( type = `Emphasized` text = `Emphasized` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
117+
)->button( text = `Default` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
118+
)->button( icon = `sap-icon://action` press = `MessageToast.show( ${$source>/id} + ' Pressed' )`
119+
).
120+
121+
client->view_display( page_02->stringify( ) ).
122+
123+
ENDMETHOD.
124+
125+
126+
METHOD on_event.
127+
128+
CASE client->get( )-event.
129+
WHEN 'BACK'.
130+
client->nav_app_leave( ).
131+
WHEN 'CLICK_HINT_ICON'.
132+
z2ui5_display_popover( `button_hint_id` ).
133+
ENDCASE.
134+
135+
ENDMETHOD.
136+
137+
138+
METHOD z2ui5_display_popover.
139+
140+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
141+
view->quick_view( placement = `Bottom` width = `auto`
142+
)->quick_view_page( pageid = `sampleInformationId`
143+
header = `Sample information`
144+
description = `Many controls provide the associations ariaLabelledBy and ariaDescribedBy for accessibility purposes. ` &&
145+
`The InvisibleText control can be used by application to provide hidden texts on the UI which can be referenced via these associations.` ).
146+
147+
client->popover_display(
148+
xml = view->stringify( )
149+
by_id = id
150+
).
151+
152+
ENDMETHOD.
153+
154+
155+
METHOD z2ui5_if_app~main.
156+
157+
me->client = client.
158+
159+
IF check_initialized = abap_false.
160+
check_initialized = abap_true.
161+
display_view( client ).
162+
ENDIF.
163+
164+
on_event( client ).
165+
166+
ENDMETHOD.
167+
ENDCLASS.

src/z2ui5_cl_demo_app_282.clas.xml

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_282</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>InvisibleText</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)