@@ -16,6 +16,7 @@ CLASS z2ui5_cl_demo_app_059 DEFINITION PUBLIC.
1616
1717 DATA mt_table TYPE ty_t_table.
1818
19+ data mv_field type string .
1920 PROTECTED SECTION .
2021 DATA client TYPE REF TO z2ui5_if_client.
2122
@@ -28,7 +29,7 @@ ENDCLASS.
2829
2930
3031
31- CLASS Z2UI5_CL_DEMO_APP_059 IMPLEMENTATION .
32+ CLASS z2ui5_cl_demo_app_059 IMPLEMENTATION .
3233
3334
3435 METHOD z2ui5_if_app ~main .
@@ -54,7 +55,8 @@ CLASS Z2UI5_CL_DEMO_APP_059 IMPLEMENTATION.
5455 set_data( ).
5556 z2ui5_cl_sample_context=>itab_filter_by_val(
5657 EXPORTING
57- val = client->get_event_arg( )
58+ val = mv_field
59+ * val = client->get_event_arg( )
5860 CHANGING
5961 tab = mt_table ).
6062
@@ -66,13 +68,18 @@ CLASS Z2UI5_CL_DEMO_APP_059 IMPLEMENTATION.
6668
6769 METHOD set_data .
6870
69- mt_table = VALUE #(
70- ( product = `table` create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
71- ( product = `chair` create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 )
72- ( product = `sofa` create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 )
73- ( product = `computer` create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 )
74- ( product = `printer` create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 )
75- ( product = `table2` create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) ).
71+ clear mt_table.
72+ DO 1000 TIMES .
73+ INSERT LINES OF VALUE ty_t_table(
74+ ( product = `table` create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
75+ ( product = `chair` create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 )
76+ ( product = `sofa` create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 )
77+ ( product = `computer` create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 )
78+ ( product = `printer` create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 )
79+ ( product = `table2` create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 )
80+ ) INTO TABLE mt_table.
81+
82+ ENDDO .
7683
7784 ENDMETHOD .
7885
@@ -87,20 +94,33 @@ CLASS Z2UI5_CL_DEMO_APP_059 IMPLEMENTATION.
8794 shownavbutton = client->check_app_prev_stack( ) ).
8895
8996 page1->message_strip(
90- text = `The search field's livechange event sends every keystroke to the backend (multiple ` &&
91- `parallel requests allowed) to live-filter the table as the user types .`
97+ text = `In abap2UI5 only one backend request can be handled at the same time per default, the app is set Busy and all other requests are ignored until the processing is finished. IN some case eg search field (live search), paralle proces ` &&
98+ `sing is needed beacause only the newest request is important and all older one can be ignored. you can set this up with the event in abap2UI5 .`
9299 type = `Information`
93100 showicon = abap_true
94101 class = `sapUiSmallMargin` ).
95102
96- DATA (lo_box ) = page1->vbox( )->text( `Search`
103+ DATA (lo_box ) = page1->hbox( ).
104+ lo_box->vbox( )->text( `Search disabled parallel (default)`
105+ )->search_field( width = `17.5rem`
106+ value = client->_bind( mv_field )
107+ livechange = client->_event(
108+ val = `BUTTON_SEARCH`
109+ * t_arg = VALUE #( ( `${$source>/value}` ) )
110+ * s_ctrl = VALUE #( check_allow_multi_req = abap_true )
111+ ) ).
112+ lo_box->vbox( )->text( `Search parallel`
97113 )->search_field( width = `17.5rem`
114+ value = client->_bind( mv_field )
98115 livechange = client->_event(
99- val = `BUTTON_SEARCH`
100- t_arg = VALUE #( ( `${$source>/value}` ) )
101- s_ctrl = VALUE #( check_allow_multi_req = abap_true ) ) ).
116+ val = `BUTTON_SEARCH`
117+ * t_arg = VALUE #( ( `${$source>/value}` ) )
118+ s_ctrl = VALUE #( check_allow_multi_req = abap_true )
119+ ) ).
120+
121+
102122
103- DATA (tab ) = lo_box ->table( client->_bind( mt_table ) ).
123+ DATA (tab ) = page1 ->table( client->_bind( mt_table ) ).
104124 DATA (lo_columns ) = tab->columns( ).
105125 lo_columns->column( )->text( `Product` ).
106126 lo_columns->column( )->text( `Date` ).
0 commit comments