Skip to content

Commit c36d9e0

Browse files
New Sample: Tile Content (#282)
1 parent 04e7d25 commit c36d9e0

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-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
@@ -559,6 +559,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
559559
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
560560
).
561561

562+
panel->generic_tile(
563+
header = 'Tile'
564+
subheader = 'Tile Content'
565+
press = client->_event( 'Z2UI5_CL_DEMO_APP_241' )
566+
mode = 'LineMode'
567+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
568+
).
569+
562570
page = page2->panel(
563571
expandable = abap_true
564572
expanded = client->_bind_edit( ms_check_expanded-more )
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
class z2ui5_cl_demo_app_241 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_241 IMPLEMENTATION.
30+
31+
32+
METHOD DISPLAY_VIEW.
33+
34+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
35+
)->page(
36+
title = 'abap2UI5 - Sample: Tile Content'
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.TileContent/sample/sap.m.sample.TileContent' ).
51+
52+
DATA(layout) = page->grid( containerquery = abap_true class = `sapUiSmallMarginTop`
53+
)->tile_content( footer = `Current Quarter` unit = `EUR` "class = `sapUiSmallMargin`
54+
)->numeric_content( scale = `M` value = `1.96`
55+
valuecolor = `Error` indicator = `Up` )->get_parent( )->get_parent(
56+
)->tile_content( footer = `Leave Requests` class = `sapUiSmallMargin`
57+
)->numeric_content( value = `3`
58+
icon = `sap-icon://travel-expense` )->get_parent( )->get_parent(
59+
)->tile_content( footer = `Hours since last Activity` class = `sapUiSmallMargin`
60+
)->numeric_content( value = `9` icon = `sap-icon://locked` )->get_parent( )->get_parent(
61+
)->tile_content( footer = `New Notifications` class = `sapUiSmallMargin`
62+
)->feed_content( contenttext = `@@notify Great outcome of the Presentation today. The new functionality and the new design was well received.`
63+
subheader = `about 1 minute ago in Computer Market` value = `132` )->get_parent( )->get_parent(
64+
)->tile_content( footer = `August 21, 2013` class = `sapUiSmallMargin`
65+
)->news_content( contenttext = `SAP Unveils Powerful New Player Comparison Tool Exclusively on NFL.com`
66+
subheader = `SAP News`
67+
).
68+
69+
client->view_display( page->stringify( ) ).
70+
71+
ENDMETHOD.
72+
73+
74+
METHOD ON_EVENT.
75+
76+
CASE client->get( )-event.
77+
WHEN 'BACK'.
78+
client->nav_app_leave( ).
79+
WHEN 'POPOVER'.
80+
z2ui5_display_popover( `hint_icon` ).
81+
ENDCASE.
82+
83+
ENDMETHOD.
84+
85+
86+
METHOD Z2UI5_DISPLAY_POPOVER.
87+
88+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
89+
view->quick_view( placement = `Bottom` width = `auto`
90+
)->quick_view_page( pageid = `sampleInformationId`
91+
header = `Sample information`
92+
description = `Shows the universal container for different content types and context information in the footer area.` ).
93+
94+
client->popover_display(
95+
xml = view->stringify( )
96+
by_id = id
97+
).
98+
99+
ENDMETHOD.
100+
101+
102+
METHOD Z2UI5_IF_APP~MAIN.
103+
104+
me->client = client.
105+
106+
IF check_initialized = abap_false.
107+
check_initialized = abap_true.
108+
display_view( client ).
109+
ENDIF.
110+
111+
on_event( client ).
112+
113+
ENDMETHOD.
114+
ENDCLASS.

src/z2ui5_cl_demo_app_241.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_241</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Tile Content</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)