Skip to content

Commit cd262a0

Browse files
New Sample: Input - Description (#292)
1 parent 6118583 commit cd262a0

File tree

3 files changed

+157
-0
lines changed

3 files changed

+157
-0
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
490490
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
491491
).
492492

493+
panel->generic_tile(
494+
header = 'Input'
495+
subheader = 'Description'
496+
press = client->_event( 'Z2UI5_CL_DEMO_APP_251' )
497+
mode = 'LineMode'
498+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
499+
).
500+
493501

494502
panel = page->panel(
495503
expandable = abap_false
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
class z2ui5_cl_demo_app_251 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+
PROTECTED SECTION.
11+
12+
DATA client TYPE REF TO z2ui5_if_client.
13+
14+
METHODS display_view
15+
IMPORTING
16+
client TYPE REF TO z2ui5_if_client.
17+
METHODS on_event
18+
IMPORTING
19+
client TYPE REF TO z2ui5_if_client.
20+
METHODS z2ui5_display_popover
21+
IMPORTING
22+
id TYPE string.
23+
24+
PRIVATE SECTION.
25+
ENDCLASS.
26+
27+
28+
29+
CLASS z2ui5_cl_demo_app_251 IMPLEMENTATION.
30+
31+
32+
METHOD DISPLAY_VIEW.
33+
34+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
35+
)->page(
36+
title = 'abap2UI5 - Sample: Input - Description'
37+
navbuttonpress = client->_event( 'BACK' )
38+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
39+
40+
page->header_content(
41+
)->button( id = `hint_icon`
42+
icon = `sap-icon://hint`
43+
tooltip = `Sample information`
44+
press = client->_event( 'POPOVER' ) ).
45+
46+
page->header_content(
47+
)->link(
48+
text = 'UI5 Demo Kit'
49+
target = '_blank'
50+
href = 'https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.Input/sample/sap.m.sample.InputDescription' ).
51+
52+
DATA(layout) = page->vertical_layout( class = `sapUiContentPadding` width = `100%` ).
53+
54+
layout->input( value = `10`
55+
description = `PC`
56+
width = `100px`
57+
fieldWidth = `60%`
58+
class = `sapUiSmallMarginBottom` ).
59+
60+
layout->input( value = `220`
61+
description = `EUR / 5 pieces`
62+
width = `200px`
63+
fieldWidth = `60px`
64+
class = `sapUiSmallMarginBottom` ).
65+
66+
layout->input( value = `220.00`
67+
description = `EUR`
68+
width = `250px`
69+
fieldWidth = `80%`
70+
showClearIcon = abap_true
71+
class = `sapUiSmallMarginBottom` ).
72+
73+
layout->input( value = `007`
74+
description = `Bastian Schweinsteiger`
75+
width = `300px`
76+
fieldWidth = `50px`
77+
class = `sapUiSmallMarginBottom` ).
78+
79+
layout->input( value = `EDP_LAPTOP`
80+
ariaDescribedBy = `descriptionNodeId`
81+
description = `IT Laptops`
82+
width = `400px`
83+
fieldWidth = `75%`
84+
class = `sapUiSmallMarginBottom` ).
85+
86+
layout->invisible_text( ns = `core` id = `descriptionNodeId` text = `Additional input description refferenced by aria-describedby.` ).
87+
88+
client->view_display( page->stringify( ) ).
89+
90+
ENDMETHOD.
91+
92+
93+
METHOD ON_EVENT.
94+
95+
CASE client->get( )-event.
96+
WHEN 'BACK'.
97+
client->nav_app_leave( ).
98+
WHEN 'POPOVER'.
99+
z2ui5_display_popover( `hint_icon` ).
100+
ENDCASE.
101+
102+
ENDMETHOD.
103+
104+
105+
METHOD Z2UI5_DISPLAY_POPOVER.
106+
107+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
108+
view->quick_view( placement = `Bottom` width = `auto`
109+
)->quick_view_page( pageid = `sampleInformationId`
110+
header = `Sample information`
111+
description = `This sample illustrates the usage of the description with input fields, e.g. description for units of measurements and currencies.` ).
112+
113+
client->popover_display(
114+
xml = view->stringify( )
115+
by_id = id
116+
).
117+
118+
ENDMETHOD.
119+
120+
121+
METHOD Z2UI5_IF_APP~MAIN.
122+
123+
me->client = client.
124+
125+
IF check_initialized = abap_false.
126+
check_initialized = abap_true.
127+
display_view( client ).
128+
ENDIF.
129+
130+
on_event( client ).
131+
132+
ENDMETHOD.
133+
ENDCLASS.

src/z2ui5_cl_demo_app_251.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_251</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Input - Description</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)