Skip to content

Commit a2e8586

Browse files
authored
viz fixes + smart controls (#449)
1 parent 7d8efb8 commit a2e8586

File tree

5 files changed

+230
-1
lines changed

5 files changed

+230
-1
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,7 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
18181818
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
18191819
).
18201820

1821-
panel->generic_tile( header = 'VizFrame Charts'
1821+
panel->generic_tile( header = 'VizFrame Charts'
18221822
subheader = ``
18231823
press = client->_event( 'Z2UI5_CL_DEMO_APP_312' )
18241824
mode = 'LineMode'
@@ -1936,6 +1936,20 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
19361936
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
19371937
).
19381938

1939+
panel->generic_tile( header = 'Growing Table with OData'
1940+
subheader = ``
1941+
press = client->_event( 'Z2UI5_CL_DEMO_APP_314' )
1942+
mode = 'LineMode'
1943+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1944+
).
1945+
1946+
panel->generic_tile( header = 'Smart Controls with Variants'
1947+
subheader = ``
1948+
press = client->_event( 'Z2UI5_CL_DEMO_APP_313' )
1949+
mode = 'LineMode'
1950+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
1951+
).
1952+
19391953
client->view_display( page->stringify( ) ).
19401954

19411955
ENDMETHOD.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
CLASS z2ui5_cl_demo_app_313 DEFINITION PUBLIC.
2+
3+
PUBLIC SECTION.
4+
5+
INTERFACES z2ui5_if_app.
6+
7+
TYPES:
8+
BEGIN OF ty_row,
9+
count TYPE i,
10+
value TYPE string,
11+
descr TYPE string,
12+
icon TYPE string,
13+
info TYPE string,
14+
checkbox TYPE abap_bool,
15+
percentage TYPE p LENGTH 5 DECIMALS 2,
16+
valuecolor TYPE string,
17+
END OF ty_row.
18+
19+
DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.
20+
DATA check_initialized TYPE abap_bool.
21+
DATA check_ui5 TYPE abap_bool.
22+
DATA mv_key TYPE string.
23+
24+
PROTECTED SECTION.
25+
PRIVATE SECTION.
26+
ENDCLASS.
27+
28+
29+
CLASS z2ui5_cl_demo_app_313 IMPLEMENTATION.
30+
31+
32+
METHOD z2ui5_if_app~main.
33+
34+
IF client->check_on_init( ).
35+
36+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
37+
38+
DATA(page) = view->shell(
39+
)->page(
40+
title = 'abap2UI5 - Smart Controls with Variants'
41+
navbuttonpress = client->_event( 'BACK' )
42+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
43+
44+
45+
page->smart_filter_bar(
46+
id = 'smartFilterBar'
47+
persistencykey = 'SmartFilterPKey'
48+
entityset = 'BookingSupplement'
49+
)->_control_configuration(
50+
)->control_configuration(
51+
previnitdatafetchinvalhelpdia = abap_false
52+
visibleinadvancedarea = abap_true
53+
key = 'TravelID'
54+
)->get_parent(
55+
)->smart_table(
56+
id = 'smartTable_ResponsiveTable'
57+
smartfilterid = 'smartFilterBar'
58+
tabletype = 'ResponsiveTable'
59+
editable = abap_false
60+
initiallyvisiblefields = 'TravelID,BookingID'
61+
entityset = 'BookingSupplement'
62+
usevariantmanagement = abap_true
63+
useexporttoexcel = abap_true
64+
usetablepersonalisation = abap_true
65+
header = 'Test'
66+
showrowcount = abap_true
67+
enableexport = abap_false
68+
enableautobinding = abap_true
69+
).
70+
71+
* page->_cc_plain_xml( ` <smartFilterBar:SmartFilterBar ` && |\n| &&
72+
* ` id="smartFilterBar"` && |\n| &&
73+
* ` entitySet="BookingSupplement" persistencyKey="SmartFilterPKey" >` && |\n| &&
74+
* ` <smartFilterBar:controlConfiguration>` && |\n| &&
75+
* ` <smartFilterBar:ControlConfiguration` && |\n| &&
76+
* ` key="TravelID" visibleInAdvancedArea="true"` && |\n| &&
77+
* ` preventInitialDataFetchInValueHelpDialog="false">` && |\n| &&
78+
* ` </smartFilterBar:ControlConfiguration>` && |\n| &&
79+
* ` </smartFilterBar:controlConfiguration>` && |\n| &&
80+
* ` </smartFilterBar:SmartFilterBar> <smartTable:SmartTable ` && |\n| &&
81+
* ` id="smartTable_ResponsiveTable"` && |\n| &&
82+
* ` smartFilterId="smartFilterBar" ` && |\n| &&
83+
* ` tableType="ResponsiveTable" ` && |\n| &&
84+
* ` editable="false"` && |\n| &&
85+
* ` initiallyVisibleFields="TravelID,BookingID"` && |\n| &&
86+
* ` entitySet="BookingSupplement" ` && |\n| &&
87+
* ` useVariantManagement="true"` && |\n| &&
88+
* ` useExportToExcel="true"` && |\n| &&
89+
* ` useTablePersonalisation="true" ` && |\n| &&
90+
* ` header="Test" ` && |\n| &&
91+
* ` showRowCount="true"` && |\n| &&
92+
* ` enableExport="false" ` && |\n| &&
93+
* ` enableAutoBinding="true">` && |\n| &&
94+
* `</smartTable:SmartTable>` ).
95+
** ` <smartForm:SmartForm editable="true">` && |\n| &&
96+
* ` <smartForm:layout>` && |\n| &&
97+
* ` <smartForm:ColumnLayout ` && |\n| &&
98+
* ` emptyCellsLarge="4"` && |\n| &&
99+
* ` labelCellsLarge="4"` && |\n| &&
100+
* ` columnsM="1"` && |\n| &&
101+
* ` columnsL="1"` && |\n| &&
102+
* ` columnsXL="1"/>` && |\n| &&
103+
* ` </smartForm:layout>` && |\n| &&
104+
* ` <smartForm:Group>` && |\n| &&
105+
* ` <smartForm:GroupElement>` && |\n| &&
106+
* ` <smartField:SmartField value="{City}" id="idPrice"/>` && |\n| &&
107+
* ` </smartForm:GroupElement>` && |\n| &&
108+
* ` </smartForm:Group>` && |\n| &&
109+
* ` </smartForm:SmartForm>` ).
110+
111+
client->view_display( val = view->stringify( ) switchdefaultmodel = abap_true ).
112+
ENDIF.
113+
114+
CASE client->get( )-event.
115+
WHEN 'BACK'.
116+
client->nav_app_leave( ).
117+
ENDCASE.
118+
119+
ENDMETHOD.
120+
ENDCLASS.

src/z2ui5_cl_demo_app_313.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_313</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>tab -smart controls</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>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
CLASS z2ui5_cl_demo_app_314 DEFINITION PUBLIC.
2+
3+
PUBLIC SECTION.
4+
INTERFACES z2ui5_if_app.
5+
6+
PROTECTED SECTION.
7+
PRIVATE SECTION.
8+
ENDCLASS.
9+
10+
11+
CLASS z2ui5_cl_demo_app_314 IMPLEMENTATION.
12+
13+
14+
METHOD z2ui5_if_app~main.
15+
16+
IF client->check_on_init( ).
17+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
18+
DATA(page) = view->shell(
19+
)->page(
20+
title = 'abap2UI5 - Table with odata source'
21+
navbuttonpress = client->_event( 'BACK' )
22+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
23+
24+
DATA(tab) = page->table(
25+
items = `{odata>/BookingSupplement}`
26+
growing = abap_true
27+
).
28+
tab->columns(
29+
)->column( )->text( 'TravelID' )->get_parent(
30+
)->column( )->text( 'BookingID' )->get_parent(
31+
)->column( )->text( 'BookingSupplementID' )->get_parent(
32+
)->column( )->text( 'SupplementID' )->get_parent(
33+
)->column( )->text( 'SupplementText' )->get_parent(
34+
)->column( )->text( 'Price' )->get_parent(
35+
)->column( )->text( 'CurrencyCode' )->get_parent(
36+
).
37+
38+
tab->items( )->column_list_item( )->cells(
39+
)->text( '{odata>TravelID}'
40+
)->text( '{odata>BookingID}'
41+
)->text( '{odata>BookingSupplementID}'
42+
)->text( '{odata>SupplementID}'
43+
)->text( '{odata>SupplementText}'
44+
)->text( '{odata>Price}'
45+
)->text( '{odata>CurrencyCode}'
46+
).
47+
48+
client->view_display( view->stringify( ) ).
49+
client->follow_up_action(
50+
client->_event_client(
51+
val = z2ui5_if_client=>cs_event-set_odata_model
52+
t_arg = value #(
53+
( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` )
54+
( `odata` ) ) ) ).
55+
ENDIF.
56+
57+
CASE client->get( )-event.
58+
WHEN 'BACK'.
59+
client->nav_app_leave( ).
60+
ENDCASE.
61+
62+
ENDMETHOD.
63+
ENDCLASS.

src/z2ui5_cl_demo_app_314.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_314</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>tab -odata</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)