1
- CLASS Z2UI5_CL_DEMO_APP_052 DEFINITION PUBLIC .
1
+ CLASS z2ui5_cl_demo_app_052 DEFINITION PUBLIC .
2
2
3
3
PUBLIC SECTION .
4
4
5
- INTERFACES Z2UI5_if_app .
5
+ INTERFACES z2ui5_if_app .
6
6
7
7
TYPES :
8
8
BEGIN OF ty_s_tab,
9
+ index TYPE string ,
9
10
selkz TYPE abap_bool ,
10
11
product TYPE string ,
11
12
create_date TYPE string ,
@@ -15,16 +16,16 @@ CLASS Z2UI5_CL_DEMO_APP_052 DEFINITION PUBLIC.
15
16
END OF ty_s_tab.
16
17
TYPES ty_t_table TYPE STANDARD TABLE OF ty_s_tab WITH EMPTY KEY .
17
18
18
- DATA mt_table TYPE ty_T_table .
19
+ DATA mt_table TYPE ty_t_table .
19
20
DATA check_initialized TYPE abap_bool .
20
- DATA client TYPE REF TO Z2UI5_if_client .
21
+ DATA client TYPE REF TO z2ui5_if_client .
21
22
22
23
DATA mv_check_popover TYPE abap_bool .
23
24
DATA mv_product TYPE string .
24
25
25
- METHODS Z2UI5_set_data .
26
- METHODS Z2UI5_display_view .
27
- METHODS Z2UI5_display_popover
26
+ METHODS z2ui5_set_data .
27
+ METHODS z2ui5_display_view .
28
+ METHODS z2ui5_display_popover
28
29
IMPORTING
29
30
id TYPE string .
30
31
@@ -34,12 +35,12 @@ ENDCLASS.
34
35
35
36
36
37
37
- CLASS Z2UI5_CL_DEMO_APP_052 IMPLEMENTATION .
38
+ CLASS z2ui5_cl_demo_app_052 IMPLEMENTATION .
38
39
39
40
40
- METHOD Z2UI5_display_popover .
41
+ METHOD z2ui5_display_popover .
41
42
42
- DATA (lo_popover ) = Z2UI5_cl_xml_view =>factory_popup( ).
43
+ DATA (lo_popover ) = z2ui5_cl_xml_view =>factory_popup( ).
43
44
44
45
lo_popover->popover( placement = `Right` title = `abap2UI5 - Popover - ` && mv_product contentwidth = `50%`
45
46
)->simple_form( editable = abap_true
@@ -66,11 +67,11 @@ CLASS Z2UI5_CL_DEMO_APP_052 IMPLEMENTATION.
66
67
ENDMETHOD .
67
68
68
69
69
- METHOD Z2UI5_display_view .
70
+ METHOD z2ui5_display_view .
70
71
71
72
DATA (view ) = z2ui5_cl_xml_view=>factory( ).
72
73
73
- data (page ) = view->page( id = `page_main`
74
+ DATA (page ) = view->page( id = `page_main`
74
75
title = 'abap2UI5 - List Report Features'
75
76
navbuttonpress = client->_event( 'BACK' )
76
77
shownavbutton = xsdbool ( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
@@ -84,30 +85,30 @@ CLASS Z2UI5_CL_DEMO_APP_052 IMPLEMENTATION.
84
85
85
86
page = page->dynamic_page( headerexpanded = abap_true headerpinned = abap_true ).
86
87
87
- DATA (header_title ) = page->title( ns = 'f' )->get( )->dynamic_page_title( ).
88
- header_title->heading( ns = 'f' )->hbox( )->title( `Item Popover` ).
89
- header_title->expanded_content( 'f' ).
90
- header_title->snapped_content( ns = 'f' ).
91
-
92
- DATA (lo_box ) = page->header( )->dynamic_page_header( pinnable = abap_true
93
- )->flex_box( alignitems = `Start` justifycontent = `SpaceBetween` )->flex_box( alignItems = `Start` ).
94
-
95
- lo_box->get_parent( )->hbox( justifycontent = `End` )->button(
96
- text = `Go`
97
- press = client->_event( `BUTTON_START` )
98
- type = `Emphasized` ).
88
+ * DATA(header_title) = page->title( ns = 'f' )->get( )->dynamic_page_title( ).
89
+ * header_title->heading( ns = 'f' )->hbox( )->title( `Item Popover` ).
90
+ * header_title->expanded_content( 'f' ).
91
+ * header_title->snapped_content( ns = 'f' ).
92
+ *
93
+ * DATA(lo_box) = page->header( )->dynamic_page_header( pinnable = abap_true
94
+ * )->flex_box( alignitems = `Start` justifycontent = `SpaceBetween` )->flex_box( alignItems = `Start` ).
95
+ *
96
+ * lo_box->get_parent( )->hbox( justifycontent = `End` )->button(
97
+ * text = `Go`
98
+ * press = client->_event( `BUTTON_START` )
99
+ * type = `Emphasized` ).
99
100
100
101
DATA (cont ) = page->content( ns = 'f' ).
101
102
102
- DATA (tab ) = cont->table( items = client->_bind_edit( val = mt_table ) ).
103
+ DATA (tab ) = cont->table( id = `tab` items = client->_bind_edit( val = mt_table ) ).
103
104
104
- tab->header_toolbar(
105
- )->toolbar(
106
- )->toolbar_spacer(
107
- )->button(
108
- icon = 'sap-icon://download'
109
- press = client->_event( 'BUTTON_DOWNLOAD' )
110
- ).
105
+ * tab->header_toolbar(
106
+ * )->toolbar(
107
+ * )->toolbar_spacer(
108
+ * )->button(
109
+ * icon = 'sap-icon://download'
110
+ * press = client->_event( 'BUTTON_DOWNLOAD' )
111
+ * ).
111
112
112
113
DATA (lo_columns ) = tab->columns( ).
113
114
lo_columns->column( )->text( text = `Product` ).
@@ -116,8 +117,8 @@ CLASS Z2UI5_CL_DEMO_APP_052 IMPLEMENTATION.
116
117
lo_columns->column( )->text( text = `Location` ).
117
118
lo_columns->column( )->text( text = `Quantity` ).
118
119
119
- DATA (lo_cells ) = tab->items( )->column_list_item( ).
120
- lo_cells->link( text = '{PRODUCT}' press = client->_event( val = `POPOVER_DETAIL` t_arg = VALUE #( ( `${$source>/id}` ) ( `${PRODUCT}` ) ) ) ).
120
+ DATA (lo_cells ) = tab->items( )->column_list_item( id = `item` ).
121
+ lo_cells->link( id = `link` text = '{PRODUCT}' press = client->_event( val = `POPOVER_DETAIL` t_arg = VALUE #( ( `${$source>/id}` ) ( `${PRODUCT}` ) ) ) ).
121
122
lo_cells->text( `{CREATE_DATE}` ).
122
123
lo_cells->text( `{CREATE_BY}` ).
123
124
lo_cells->text( `{STORAGE_LOCATION}` ).
@@ -128,31 +129,32 @@ CLASS Z2UI5_CL_DEMO_APP_052 IMPLEMENTATION.
128
129
ENDMETHOD .
129
130
130
131
131
- METHOD Z2UI5_if_app ~main .
132
+ METHOD z2ui5_if_app ~main .
132
133
133
134
me ->client = client .
134
135
135
136
IF check_initialized = abap_false .
136
137
check_initialized = abap_true .
137
- Z2UI5_display_view( ).
138
+ z2ui5_display_view( ).
139
+ z2ui5_set_data( ).
138
140
RETURN .
139
141
ENDIF .
140
142
141
143
CASE client->get( )-event.
142
144
143
- when `BUTTON_DETAILS` .
145
+ WHEN `BUTTON_DETAILS` .
144
146
client->popover_destroy( ).
145
147
146
148
WHEN `POPOVER_DETAIL` .
147
149
DATA (lt_arg ) = client->get( )-t_event_arg.
148
150
DATA (lv_open_by_id ) = lt_arg[ 1 ].
149
151
mv_check_popover = abap_true .
150
152
mv_product = lt_arg[ 2 ].
151
- Z2UI5_display_popover ( lv_open_by_id ).
153
+ z2ui5_display_popover ( lv_open_by_id ).
152
154
153
- WHEN 'BUTTON_START' .
154
- Z2UI5_set_data( ).
155
- client->view_model_update( ).
155
+ * WHEN 'BUTTON_START'.
156
+ *
157
+ * client->view_model_update( ).
156
158
157
159
WHEN 'BACK' .
158
160
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
@@ -163,7 +165,7 @@ CLASS Z2UI5_CL_DEMO_APP_052 IMPLEMENTATION.
163
165
ENDMETHOD .
164
166
165
167
166
- METHOD Z2UI5_set_data .
168
+ METHOD z2ui5_set_data .
167
169
168
170
mt_table = VALUE #(
169
171
( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
@@ -216,6 +218,9 @@ CLASS Z2UI5_CL_DEMO_APP_052 IMPLEMENTATION.
216
218
( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 )
217
219
).
218
220
221
+ LOOP AT mt_table REFERENCE INTO DATA (lr_tab ).
222
+ lr_tab->index = sy -tabix .
223
+ ENDLOOP .
219
224
220
225
ENDMETHOD .
221
226
ENDCLASS .
0 commit comments