Skip to content

Commit 1bf5612

Browse files
New Sample: Numeric Content with Icon (#310)
1 parent 6235bd0 commit 1bf5612

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-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
@@ -615,6 +615,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
615615
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
616616
).
617617

618+
panel->generic_tile(
619+
header = 'Tile'
620+
subheader = 'Numeric Content with Icon'
621+
press = client->_event( 'Z2UI5_CL_DEMO_APP_263' )
622+
mode = 'LineMode'
623+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
624+
).
625+
618626
page = page2->panel(
619627
expandable = abap_true
620628
expanded = client->_bind_edit( ms_check_expanded-more )
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
class z2ui5_cl_demo_app_263 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_263 IMPLEMENTATION.
30+
31+
32+
METHOD DISPLAY_VIEW.
33+
34+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
35+
)->page(
36+
title = 'abap2UI5 - Sample: Numeric Content with Icon'
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.NumericContent/sample/sap.m.sample.NumericContentIcon' ).
51+
52+
page->numeric_content( value = `65` scale = `MM`
53+
valueColor = `Error` indicator = `Down` icon = `sap-icon://travel-expense`
54+
class = `sapUiSmallMargin` press = client->_event( 'press' ) ).
55+
page->numeric_content( value = `11` scale = `MM`
56+
valueColor = `Critical` indicator = `Up`
57+
icon = `test-resources/sap/m/demokit/sample/NumericContentIcon/images/grass.jpg` class = `sapUiSmallMargin`
58+
press = client->_event( 'press' ) ).
59+
60+
client->view_display( page->stringify( ) ).
61+
62+
ENDMETHOD.
63+
64+
65+
METHOD ON_EVENT.
66+
67+
CASE client->get( )-event.
68+
WHEN 'BACK'.
69+
client->nav_app_leave( ).
70+
WHEN 'press'.
71+
client->message_toast_display( `The numeric content is pressed.` ).
72+
WHEN 'POPOVER'.
73+
z2ui5_display_popover( `hint_icon` ).
74+
ENDCASE.
75+
76+
ENDMETHOD.
77+
78+
79+
METHOD Z2UI5_DISPLAY_POPOVER.
80+
81+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
82+
view->quick_view( placement = `Bottom` width = `auto`
83+
)->quick_view_page( pageid = `sampleInformationId`
84+
header = `Sample information`
85+
description = `Shows NumericContent including an icon.` ).
86+
87+
client->popover_display(
88+
xml = view->stringify( )
89+
by_id = id
90+
).
91+
92+
ENDMETHOD.
93+
94+
95+
METHOD Z2UI5_IF_APP~MAIN.
96+
97+
me->client = client.
98+
99+
IF check_initialized = abap_false.
100+
check_initialized = abap_true.
101+
display_view( client ).
102+
ENDIF.
103+
104+
on_event( client ).
105+
106+
ENDMETHOD.
107+
ENDCLASS.

src/z2ui5_cl_demo_app_263.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_263</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Numeric Content with Icon</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)