Skip to content

Commit e469243

Browse files
authored
Added smaple with invalid date and time (#352)
* added smaple with invalid date and time * abalint fixes
1 parent 7c92a42 commit e469243

7 files changed

+134
-37
lines changed

src/z2ui5_cl_demo_app_002.clas.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ CLASS Z2UI5_CL_DEMO_APP_002 IMPLEMENTATION.
226226
)->get_parent( )->get_parent( ).
227227

228228
lv_test->label( 'Segmented Button'
229-
)->segmented_button( client->_bind_edit( screen-segment_key )
229+
)->segmented_button( selected_key = client->_bind_edit( screen-segment_key )
230230
)->items(
231231
)->segmented_button_item(
232232
key = 'BLUE'

src/z2ui5_cl_demo_app_026.clas.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ CLASS Z2UI5_CL_DEMO_APP_026 IMPLEMENTATION.
7676
)->label( 'Link'
7777
)->link( text = 'Documentation UI5 Popover Control' href = 'https://openui5.hana.ondemand.com/entity/sap.m.Popover'
7878
)->label( 'placement'
79-
)->segmented_button( client->_bind_edit( mv_placement )
79+
)->segmented_button( selected_key = client->_bind_edit( mv_placement )
8080
)->items(
8181
)->segmented_button_item(
8282
key = 'Left'

src/z2ui5_cl_demo_app_049.clas.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ CLASS Z2UI5_CL_DEMO_APP_049 IMPLEMENTATION.
109109
).
110110

111111

112-
page->segmented_button( client->_bind_edit( mv_key )
112+
page->segmented_button( selected_key = client->_bind_edit( mv_key )
113113
)->items(
114114
)->segmented_button_item(
115115
key = 'VIEW_REFRESH'

src/z2ui5_cl_demo_app_081.clas.abap

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ ENDCLASS.
4040
CLASS Z2UI5_CL_DEMO_APP_081 IMPLEMENTATION.
4141

4242

43-
* <SIGNATURE>---------------------------------------------------------------------------------------+
44-
* | Instance Protected Method Z2UI5_CL_DEMO_APP_026->Z2UI5_DISPLAY_POPOVER
45-
* +-------------------------------------------------------------------------------------------------+
46-
* | [--->] ID TYPE STRING
47-
* +--------------------------------------------------------------------------------------</SIGNATURE>
4843
METHOD Z2UI5_display_popover.
4944

5045
DATA(view) = Z2UI5_cl_xml_view=>factory_popup( ).
@@ -72,12 +67,6 @@ CLASS Z2UI5_CL_DEMO_APP_081 IMPLEMENTATION.
7267

7368
ENDMETHOD.
7469

75-
76-
* <SIGNATURE>---------------------------------------------------------------------------------------+
77-
* | Instance Protected Method Z2UI5_CL_DEMO_APP_026->Z2UI5_DISPLAY_POPOVER_LIST
78-
* +-------------------------------------------------------------------------------------------------+
79-
* | [--->] ID TYPE STRING
80-
* +--------------------------------------------------------------------------------------</SIGNATURE>
8170
METHOD Z2UI5_display_popover_list.
8271

8372
DATA(view) = Z2UI5_cl_xml_view=>factory_popup( ).
@@ -103,10 +92,6 @@ CLASS Z2UI5_CL_DEMO_APP_081 IMPLEMENTATION.
10392
ENDMETHOD.
10493

10594

106-
* <SIGNATURE>---------------------------------------------------------------------------------------+
107-
* | Instance Protected Method Z2UI5_CL_DEMO_APP_026->Z2UI5_DISPLAY_VIEW
108-
* +-------------------------------------------------------------------------------------------------+
109-
* +--------------------------------------------------------------------------------------</SIGNATURE>
11095
METHOD Z2UI5_display_view.
11196

11297
DATA(view) = z2ui5_cl_xml_view=>factory( ).
@@ -126,7 +111,7 @@ CLASS Z2UI5_CL_DEMO_APP_081 IMPLEMENTATION.
126111
)->label( 'Link'
127112
)->link( text = 'Documentation UI5 Popover Control' href = 'https://openui5.hana.ondemand.com/entity/sap.m.Popover'
128113
)->label( 'placement'
129-
)->segmented_button( client->_bind_edit( mv_placement )
114+
)->segmented_button( selected_key = client->_bind_edit( mv_placement )
130115
)->items(
131116
)->segmented_button_item(
132117
key = 'Left'
@@ -156,12 +141,6 @@ CLASS Z2UI5_CL_DEMO_APP_081 IMPLEMENTATION.
156141

157142
ENDMETHOD.
158143

159-
160-
* <SIGNATURE>---------------------------------------------------------------------------------------+
161-
* | Instance Public Method Z2UI5_CL_DEMO_APP_026->Z2UI5_IF_APP~MAIN
162-
* +-------------------------------------------------------------------------------------------------+
163-
* | [--->] CLIENT TYPE REF TO Z2UI5_IF_CLIENT
164-
* +--------------------------------------------------------------------------------------</SIGNATURE>
165144
METHOD Z2UI5_if_app~main.
166145

167146
me->client = client.
@@ -178,10 +157,6 @@ CLASS Z2UI5_CL_DEMO_APP_081 IMPLEMENTATION.
178157
ENDMETHOD.
179158

180159

181-
* <SIGNATURE>---------------------------------------------------------------------------------------+
182-
* | Instance Protected Method Z2UI5_CL_DEMO_APP_026->Z2UI5_ON_EVENT
183-
* +-------------------------------------------------------------------------------------------------+
184-
* +--------------------------------------------------------------------------------------</SIGNATURE>
185160
METHOD Z2UI5_on_event.
186161

187162
CASE client->get( )-event.
@@ -212,10 +187,6 @@ CLASS Z2UI5_CL_DEMO_APP_081 IMPLEMENTATION.
212187
ENDMETHOD.
213188

214189

215-
* <SIGNATURE>---------------------------------------------------------------------------------------+
216-
* | Instance Protected Method Z2UI5_CL_DEMO_APP_026->Z2UI5_ON_INIT
217-
* +-------------------------------------------------------------------------------------------------+
218-
* +--------------------------------------------------------------------------------------</SIGNATURE>
219190
METHOD Z2UI5_on_init.
220191

221192
mv_placement = 'Left'.

src/z2ui5_cl_demo_app_109.clas.abap

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ CLASS z2ui5_cl_demo_app_109 IMPLEMENTATION.
3434

3535
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
3636
view->quick_view( placement = mv_placement
37-
* beforeclose = client->_event( val = `CLOSE_POPOVER` )
38-
* beforeclose = client->_event_client( client->cs_event-popover_close )
39-
* afterclose = client->_event( `CLOSE_POPOVER` )
4037
)->quick_view_page( pageid = `employeePageId`
4138
header = `Employee Info`
4239
title = `choper725`
@@ -88,7 +85,7 @@ CLASS z2ui5_cl_demo_app_109 IMPLEMENTATION.
8885
)->content( 'form'
8986
)->title( 'QuickView Popover'
9087
)->label( 'placement'
91-
)->segmented_button( client->_bind_edit( mv_placement )
88+
)->segmented_button( selected_key = client->_bind_edit( mv_placement )
9289
)->items(
9390
)->segmented_button_item(
9491
key = 'Left'
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
CLASS z2ui5_cl_demo_app_118 DEFINITION
2+
PUBLIC
3+
FINAL
4+
CREATE PUBLIC .
5+
6+
PUBLIC SECTION.
7+
8+
INTERFACES if_serializable_object .
9+
INTERFACES z2ui5_if_app .
10+
11+
TYPES: BEGIN OF s_row,
12+
id TYPE i,
13+
descr TYPE string,
14+
adate TYPE d,
15+
atime TYPE t,
16+
END OF s_row.
17+
TYPES: t_rows TYPE STANDARD TABLE OF s_row WITH EMPTY KEY.
18+
19+
DATA: problematic_rows TYPE t_rows.
20+
DATA: these_are_fine_rows TYPE t_rows.
21+
22+
DATA: check_initialized TYPE abap_bool.
23+
PROTECTED SECTION.
24+
PRIVATE SECTION.
25+
ENDCLASS.
26+
27+
28+
29+
CLASS z2ui5_cl_demo_app_118 IMPLEMENTATION.
30+
METHOD z2ui5_if_app~main.
31+
32+
IF check_initialized = abap_false.
33+
check_initialized = abap_true.
34+
problematic_rows = VALUE #(
35+
( id = 1 descr = 'First row' adate = sy-datum atime = sy-uzeit )
36+
( id = 2 descr = 'Second row' adate = sy-datum atime = sy-uzeit )
37+
( id = 3 descr = 'Third row' adate = '' atime = '' )
38+
( id = 4 descr = 'Fourth row' adate = '' atime = '' )
39+
( id = 5 descr = 'Fifth row' adate = sy-datum atime = sy-uzeit )
40+
).
41+
42+
these_are_fine_rows = VALUE #(
43+
( id = 1 descr = 'First row' adate = sy-datum atime = sy-uzeit )
44+
( id = 2 descr = 'Second row' adate = 0 atime = 0 )
45+
( id = 3 descr = 'Third row' adate = 0 atime = 0 )
46+
( id = 4 descr = 'Fourth row' adate = 0 atime = 0 )
47+
( id = 5 descr = 'Fifth row' adate = sy-datum atime = sy-uzeit )
48+
).
49+
50+
ENDIF.
51+
52+
53+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
54+
55+
DATA(page) = view->_z2ui5( )->title( 'ABAP2UI5 Weird behavior showcase' )->shell(
56+
)->page(
57+
title = 'ABAP2UI5 Weird behavior showcase'
58+
navbuttonpress = client->_event( 'BACK' )
59+
showheader = abap_true ).
60+
61+
DATA(tab_ko) = page->table(
62+
mode = 'MultiSelect'
63+
items = client->_bind_edit( problematic_rows ) ).
64+
65+
tab_ko->header_toolbar(
66+
)->toolbar(
67+
)->title( |This table has the weird behavior|
68+
)->toolbar_spacer(
69+
)->button(
70+
text = |Go|
71+
icon = 'sap-icon://blur'
72+
press = client->_event( 'ON_BTN_GO' ) ).
73+
74+
tab_ko->columns(
75+
)->column( )->text( 'ID' )->get_parent(
76+
)->column( )->text( 'Description' )->get_parent(
77+
)->column( )->text( 'Date ' )->get_parent(
78+
)->column( )->text( 'Time' ).
79+
80+
tab_ko->items(
81+
)->column_list_item(
82+
)->cells(
83+
)->object_identifier( title = '{ID}' text = '{DESCR}' )->get_parent(
84+
)->text( '{ADATE}'
85+
)->text( '{ATIME}' ).
86+
87+
88+
DATA(tab_ok) = page->table(
89+
mode = 'MultiSelect'
90+
items = client->_bind_edit( these_are_fine_rows ) ).
91+
92+
tab_ok->header_toolbar(
93+
)->toolbar(
94+
)->title( |This table is fine| ).
95+
96+
tab_ok->columns(
97+
)->column( )->text( 'ID' )->get_parent(
98+
)->column( )->text( 'Description' )->get_parent(
99+
)->column( )->text( 'Date ' )->get_parent(
100+
)->column( )->text( 'Time' ).
101+
102+
tab_ok->items(
103+
)->column_list_item(
104+
)->cells(
105+
)->object_identifier( title = '{ID}' text = '{DESCR}' )->get_parent(
106+
)->text( '{ADATE}'
107+
)->text( '{ATIME}' ).
108+
109+
client->view_display( view->stringify( ) ).
110+
111+
ENDMETHOD.
112+
113+
ENDCLASS.

src/z2ui5_cl_demo_app_118.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_118</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>data binding tables with invalid date and time</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)