Skip to content

Commit 50a4a27

Browse files
New Sample: Feed Content (#336)
1 parent 4afc782 commit 50a4a27

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
320320
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
321321
).
322322

323+
323324
panel = page->panel(
324325
expandable = abap_false
325326
expanded = abap_true
@@ -682,6 +683,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
682683
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
683684
).
684685

686+
panel->generic_tile(
687+
header = 'Tile'
688+
subheader = 'Feed Content'
689+
press = client->_event( 'Z2UI5_CL_DEMO_APP_275' )
690+
mode = 'LineMode'
691+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
692+
).
693+
685694
page = page2->panel(
686695
expandable = abap_true
687696
expanded = client->_bind_edit( ms_check_expanded-more )
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
CLASS z2ui5_cl_demo_app_275 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_275 IMPLEMENTATION.
31+
32+
33+
METHOD display_view.
34+
35+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
36+
)->page(
37+
title = 'abap2UI5 - Sample: Feed Content'
38+
navbuttonpress = client->_event( 'BACK' )
39+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
40+
41+
page->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->header_content(
48+
)->link(
49+
text = 'UI5 Demo Kit'
50+
target = '_blank'
51+
href = 'https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.FeedContent/sample/sap.m.sample.FeedContent' ).
52+
53+
page->feed_content(
54+
contenttext = `@@notify Great outcome of the Presentation today. The new functionality and the new design was well received.`
55+
subheader = `about 1 minute ago in Computer Market`
56+
class = `sapUiSmallMargin` press = client->_event( `press` ) )->get_parent(
57+
)->feed_content(
58+
contenttext = `@@notify Great outcome of the Presentation today. The new functionality and the new design was well received.`
59+
subheader = `about 1 minute ago in Computer Market` value = `999`
60+
class = `sapUiSmallMargin` press = client->_event( `press` )
61+
).
62+
63+
client->view_display( page->stringify( ) ).
64+
65+
66+
ENDMETHOD.
67+
68+
69+
METHOD on_event.
70+
71+
CASE client->get( )-event.
72+
WHEN 'BACK'.
73+
client->nav_app_leave( ).
74+
WHEN 'CLICK_HINT_ICON'.
75+
z2ui5_display_popover( `button_hint_id` ).
76+
WHEN 'press'.
77+
client->message_toast_display( `The feed content is pressed.` ).
78+
ENDCASE.
79+
80+
ENDMETHOD.
81+
82+
83+
METHOD z2ui5_display_popover.
84+
85+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
86+
view->quick_view( placement = `Bottom` width = `auto`
87+
)->quick_view_page( pageid = `sampleInformationId`
88+
header = `Sample information`
89+
description = `Shows the tile containing the text of the feed, a subheader, and a numeric value.` ).
90+
91+
client->popover_display(
92+
xml = view->stringify( )
93+
by_id = id
94+
).
95+
96+
ENDMETHOD.
97+
98+
99+
METHOD z2ui5_if_app~main.
100+
101+
me->client = client.
102+
103+
IF check_initialized = abap_false.
104+
check_initialized = abap_true.
105+
display_view( client ).
106+
ENDIF.
107+
108+
on_event( client ).
109+
110+
ENDMETHOD.
111+
ENDCLASS.

src/z2ui5_cl_demo_app_275.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_275</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Feed 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)