From 867bf2a1ef71046065664abe67cb04634a541fb0 Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Sat, 18 Mar 2023 10:44:57 +0100 Subject: [PATCH] table growing entries (#104) --- src/00/z2ui5_cl_app_demo_06.clas.abap | 17 +++++++++++------ src/z2ui5_cl_http_handler.clas.locals_imp.abap | 1 + src/z2ui5_if_view.intf.abap | 13 +++++++------ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/00/z2ui5_cl_app_demo_06.clas.abap b/src/00/z2ui5_cl_app_demo_06.clas.abap index 82fcfde9..7a9aaf6d 100644 --- a/src/00/z2ui5_cl_app_demo_06.clas.abap +++ b/src/00/z2ui5_cl_app_demo_06.clas.abap @@ -22,7 +22,7 @@ ENDCLASS. -CLASS Z2UI5_CL_APP_DEMO_06 IMPLEMENTATION. +CLASS z2ui5_cl_app_demo_06 IMPLEMENTATION. METHOD z2ui5_if_app~controller. @@ -31,8 +31,10 @@ CLASS Z2UI5_CL_APP_DEMO_06 IMPLEMENTATION. WHEN client->cs-lifecycle_method-on_init. - t_tab = REDUCE #( INIT ret = VALUE #( ) FOR n = 1 WHILE n < 101 NEXT ret = - VALUE #( BASE ret ( title = 'Hans' value = 'red' info = 'completed' descr = 'this is a description' checkbox = abap_true ) ) ). + DO 1000 TIMES. + DATA(ls_row) = VALUE ty_Row( title = 'row_' && sy-index value = 'red' info = 'completed' descr = 'this is a description' checkbox = abap_true ). + INSERT ls_row INTO TABLE t_tab. + ENDDO. WHEN client->cs-lifecycle_method-on_event. @@ -56,13 +58,16 @@ CLASS Z2UI5_CL_APP_DEMO_06 IMPLEMENTATION. DATA(view) = client->factory_view( ). DATA(page) = view->page( title = 'abap2UI5 - Scroll Container with Table and Toolbar' navbuttontap = view->_event( 'BACK' ) ). - page->header_content( )->link( text = 'Go to Source Code' href = client->get( )-s_request-url_source_code ). + page->header_content( )->link( text = 'Go to Source Code' href = client->get( )-s_request-url_source_code ). "set table and container DATA(tab) = page->scroll_container( '70%' )->table( + growing = abap_true + growingThreshold = '20' + growingScrollToLoad = abap_true items = view->_bind_one_way( t_tab ) - sticky = 'ColumnHeaders,HeaderToolbar' - ). + sticky = 'ColumnHeaders,HeaderToolbar' + ). "set toolbar tab->header_toolbar( )->overflow_toolbar( diff --git a/src/z2ui5_cl_http_handler.clas.locals_imp.abap b/src/z2ui5_cl_http_handler.clas.locals_imp.abap index e09d2c61..de419f95 100644 --- a/src/z2ui5_cl_http_handler.clas.locals_imp.abap +++ b/src/z2ui5_cl_http_handler.clas.locals_imp.abap @@ -1761,6 +1761,7 @@ CLASS z2ui5_lcl_if_view IMPLEMENTATION. ( n = 'headerText' v = headertext ) ( n = 'growing' v = growing ) ( n = 'growingThreshold' v = growingthreshold ) + ( n = 'growingScrollToLoad' v = growingScrollToLoad ) ( n = 'sticky' v = sticky ) ( n = 'mode' v = mode ) ) ). diff --git a/src/z2ui5_if_view.intf.abap b/src/z2ui5_if_view.intf.abap index c68d6b3b..d3bc3b81 100644 --- a/src/z2ui5_if_view.intf.abap +++ b/src/z2ui5_if_view.intf.abap @@ -162,12 +162,13 @@ INTERFACE z2ui5_if_view METHODS table IMPORTING - items TYPE clike OPTIONAL - growing TYPE clike OPTIONAL - growingThreshold TYPE clike OPTIONAL - headerText TYPE clike OPTIONAL - sticky TYPE clike OPTIONAL - mode TYPE clike OPTIONAL + items TYPE clike OPTIONAL + growing TYPE clike OPTIONAL + growingThreshold TYPE clike OPTIONAL + growingScrollToLoad TYPE clike OPTIONAL + headerText TYPE clike OPTIONAL + sticky TYPE clike OPTIONAL + mode TYPE clike OPTIONAL PREFERRED PARAMETER items RETURNING VALUE(result) TYPE REF TO z2ui5_if_view.