Skip to content

Commit afa4d77

Browse files
New Sample: Standard List Item - Info State Invert (#371)
1 parent 9a84570 commit afa4d77

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
@@ -999,6 +999,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
999999
mode = 'LineMode'
10001000
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom').
10011001

1002+
panel->generic_tile(
1003+
header = 'Standard List Item '
1004+
subheader = 'Info State Inverted'
1005+
press = client->_event( 'Z2UI5_CL_DEMO_APP_286' )
1006+
mode = 'LineMode'
1007+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1008+
).
1009+
10021010
panel = page->panel(
10031011
expandable = abap_false
10041012
expanded = abap_true
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
CLASS z2ui5_cl_demo_app_286 DEFINITION
2+
PUBLIC
3+
CREATE PUBLIC.
4+
5+
PUBLIC SECTION.
6+
7+
INTERFACES z2ui5_if_app.
8+
9+
TYPES:
10+
BEGIN OF ty_name,
11+
title TYPE string,
12+
desc TYPE string,
13+
icon TYPE string,
14+
highlight TYPE string,
15+
info TYPE string,
16+
END OF ty_name .
17+
18+
DATA lt_o_model TYPE TABLE OF ty_name.
19+
DATA check_initialized TYPE abap_bool.
20+
21+
PROTECTED SECTION.
22+
23+
DATA client TYPE REF TO z2ui5_if_client.
24+
25+
METHODS display_view
26+
IMPORTING
27+
client TYPE REF TO z2ui5_if_client.
28+
METHODS on_event
29+
IMPORTING
30+
client TYPE REF TO z2ui5_if_client.
31+
METHODS z2ui5_display_popover
32+
IMPORTING
33+
id TYPE string.
34+
35+
PRIVATE SECTION.
36+
ENDCLASS.
37+
38+
39+
40+
CLASS z2ui5_cl_demo_app_286 IMPLEMENTATION.
41+
42+
43+
METHOD display_view.
44+
45+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
46+
)->page(
47+
title = 'abap2UI5 - Sample: Standard List Item - Info State Inverted'
48+
navbuttonpress = client->_event( 'BACK' )
49+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
50+
51+
page->header_content(
52+
)->button( id = `button_hint_id`
53+
icon = `sap-icon://hint`
54+
tooltip = `Sample information`
55+
press = client->_event( 'CLICK_HINT_ICON' ) ).
56+
57+
page->header_content(
58+
)->link(
59+
text = 'UI5 Demo Kit'
60+
target = '_blank'
61+
href = 'https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.StandardListItem/sample/sap.m.sample.StandardListItemInfoStateInverted' ).
62+
63+
page->list(
64+
id = `myList`
65+
mode = `MultiSelect`
66+
headertext = `Inverted Info State`
67+
items = client->_bind( lt_o_model )
68+
)->items(
69+
)->standard_list_item(
70+
title = '{TITLE}'
71+
description = '{DESC}'
72+
icon = '{ICON}'
73+
iconInset = abap_false
74+
highlight = '{HIGHLIGHT}'
75+
info = '{INFO}'
76+
infostate = '{HIGHLIGHT}'
77+
infostateinverted = abap_true
78+
).
79+
80+
client->view_display( page->stringify( ) ).
81+
82+
ENDMETHOD.
83+
84+
85+
METHOD on_event.
86+
87+
CASE client->get( )-event.
88+
WHEN 'BACK'.
89+
client->nav_app_leave( ).
90+
WHEN 'CLICK_HINT_ICON'.
91+
z2ui5_display_popover( `button_hint_id` ).
92+
ENDCASE.
93+
94+
ENDMETHOD.
95+
96+
97+
METHOD z2ui5_display_popover.
98+
99+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
100+
view->quick_view( placement = `Bottom` width = `auto`
101+
)->quick_view_page( pageid = `sampleInformationId`
102+
header = `Sample information`
103+
description = `This sample demonstrates the inverted rendering behavior of the info text and the info state of the StandardListItem control.` ).
104+
105+
client->popover_display(
106+
xml = view->stringify( )
107+
by_id = id
108+
).
109+
110+
ENDMETHOD.
111+
112+
113+
METHOD z2ui5_if_app~main.
114+
115+
me->client = client.
116+
117+
IF check_initialized = abap_false.
118+
check_initialized = abap_true.
119+
display_view( client ).
120+
121+
lt_o_model = VALUE #(
122+
( title = 'Title text' desc = 'Description text' icon = 'sap-icon://favorite' highlight = 'Success' info = 'Completed' )
123+
( title = 'Title text' desc = 'Description text' icon = 'sap-icon://employee' highlight = 'Error' info = 'Incomplete' )
124+
( title = 'Title text' icon = 'sap-icon://accept' highlight = 'Information' info = 'Information' )
125+
( title = 'Title text' icon = 'sap-icon://activities' highlight = 'None' info = 'None' )
126+
( title = 'Title text' desc = 'Description text' icon = 'sap-icon://badge' highlight = 'Warning' info = 'Warning' )
127+
).
128+
ENDIF.
129+
130+
on_event( client ).
131+
132+
ENDMETHOD.
133+
ENDCLASS.

src/z2ui5_cl_demo_app_286.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_286</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Standard List Item - Info State Inverted</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)