Skip to content

Commit ad52f74

Browse files
Update Demo 118 and New Demo 283 (#353)
* Commit * Update Demo 118 * Feed Input - Based on sample from UI5 Demo Kit
1 parent e469243 commit ad52f74

File tree

4 files changed

+170
-3
lines changed

4 files changed

+170
-3
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
564564
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
565565
).
566566

567+
panel->generic_tile(
568+
header = 'Feed Input 2'
569+
press = client->_event( 'Z2UI5_CL_DEMO_APP_283' )
570+
mode = 'LineMode'
571+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
572+
).
573+
567574

568575
panel = page->panel(
569576
expandable = abap_false

src/z2ui5_cl_demo_app_118.clas.abap

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ ENDCLASS.
2727

2828

2929
CLASS z2ui5_cl_demo_app_118 IMPLEMENTATION.
30+
31+
3032
METHOD z2ui5_if_app~main.
3133

3234
IF check_initialized = abap_false.
@@ -80,7 +82,8 @@ CLASS z2ui5_cl_demo_app_118 IMPLEMENTATION.
8082
tab_ko->items(
8183
)->column_list_item(
8284
)->cells(
83-
)->object_identifier( title = '{ID}' text = '{DESCR}' )->get_parent(
85+
)->object_identifier( title = '{ID}' )->get_parent(
86+
)->text( '{DESCR}'
8487
)->text( '{ADATE}'
8588
)->text( '{ATIME}' ).
8689

@@ -102,12 +105,12 @@ CLASS z2ui5_cl_demo_app_118 IMPLEMENTATION.
102105
tab_ok->items(
103106
)->column_list_item(
104107
)->cells(
105-
)->object_identifier( title = '{ID}' text = '{DESCR}' )->get_parent(
108+
)->object_identifier( title = '{ID}' )->get_parent(
109+
)->text( '{DESCR}'
106110
)->text( '{ADATE}'
107111
)->text( '{ATIME}' ).
108112

109113
client->view_display( view->stringify( ) ).
110114

111115
ENDMETHOD.
112-
113116
ENDCLASS.
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
CLASS z2ui5_cl_demo_app_283 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_283 IMPLEMENTATION.
31+
32+
33+
METHOD display_view.
34+
" Define the base URL for the server
35+
DATA base_url TYPE string VALUE 'https://sapui5.hana.ondemand.com/'.
36+
37+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
38+
)->page(
39+
title = 'abap2UI5 - Sample: Feed Input'
40+
navbuttonpress = client->_event( 'BACK' )
41+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
42+
43+
page->header_content(
44+
)->button( id = `button_hint_id`
45+
icon = `sap-icon://hint`
46+
tooltip = `Sample information`
47+
press = client->_event( 'CLICK_HINT_ICON' ) ).
48+
49+
page->header_content(
50+
)->link(
51+
text = 'UI5 Demo Kit'
52+
target = '_blank'
53+
href = base_url && 'sdk/#/entity/sap.m.FeedInput/sample/sap.m.sample.FeedInput' ).
54+
55+
page->_generic_property( VALUE #( n = `core:require` v = `{ MessageToast: 'sap/m/MessageToast' }` ) ).
56+
57+
page->label( text = `Without Icon` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ).
58+
page->feed_input(
59+
post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )`
60+
showicon = abap_false ).
61+
62+
page->label( text = `With Icon Placeholder` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ).
63+
page->feed_input(
64+
post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )`
65+
showicon = abap_true ).
66+
67+
page->label( text = `With Icon Placeholder` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ).
68+
page->feed_input(
69+
post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )`
70+
showicon = abap_true
71+
icon = base_url && `test-resources/sap/m/images/george_washington.jpg` ).
72+
73+
page->label( text = `Disabled` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ).
74+
page->feed_input(
75+
post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )`
76+
enabled = abap_false
77+
showicon = abap_true
78+
icon = base_url && `test-resources/sap/m/images/george_washington.jpg` ).
79+
80+
page->label( text = `Rows Set to 5` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ).
81+
page->feed_input(
82+
post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )`
83+
rows = `5` ).
84+
85+
page->label( text = `With Exceeded Text` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ).
86+
page->feed_input(
87+
post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )`
88+
maxlength = `20`
89+
showexceededtext = abap_true ).
90+
91+
page->label( text = `With Growing` class = `sapUiSmallMarginTop sapUiTinyMarginBottom` ).
92+
page->feed_input(
93+
post = `MessageToast.show( 'Posted new feed entry: ' + ${$source>/value} )`
94+
growing = abap_true ).
95+
96+
client->view_display( page->stringify( ) ).
97+
98+
ENDMETHOD.
99+
100+
101+
METHOD on_event.
102+
103+
CASE client->get( )-event.
104+
WHEN 'BACK'.
105+
client->nav_app_leave( ).
106+
WHEN 'CLICK_HINT_ICON'.
107+
z2ui5_display_popover( `button_hint_id` ).
108+
ENDCASE.
109+
110+
ENDMETHOD.
111+
112+
113+
METHOD z2ui5_display_popover.
114+
115+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
116+
view->quick_view( placement = `Bottom` width = `auto`
117+
)->quick_view_page( pageid = `sampleInformationId`
118+
header = `Sample information`
119+
description = `This sample shows a standalone feed input with different settings.` ).
120+
121+
client->popover_display(
122+
xml = view->stringify( )
123+
by_id = id
124+
).
125+
126+
ENDMETHOD.
127+
128+
129+
METHOD z2ui5_if_app~main.
130+
131+
me->client = client.
132+
133+
IF check_initialized = abap_false.
134+
check_initialized = abap_true.
135+
display_view( client ).
136+
ENDIF.
137+
138+
on_event( client ).
139+
140+
ENDMETHOD.
141+
ENDCLASS.

src/z2ui5_cl_demo_app_283.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_283</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Feed Input</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)