diff --git a/docs/public/api/client-api.json b/docs/public/api/client-api.json index c9dae31f..d3b33840 100644 --- a/docs/public/api/client-api.json +++ b/docs/public/api/client-api.json @@ -550,6 +550,61 @@ ], "returns": "string" }, + { + "name": "_bind_tab", + "group": "Data binding", + "doc": [ + "Bind a LARGE table to a list control - the browser gets it a window at a time instead of whole. Returns the value binding like _bind( ) (`items = client->_bind_tab( mt_rows )`); the rows of the template bind relative (`{NAME}`), as with _bind( ).", + "The rows stay in the app's attribute. The response carries the first `window` rows, and next to them the window's state under `/__WINDOW/` - TOTAL, the rows the filter lets through, COUNT, the rows sent, and SIZE. The control's list binding knows the full length and asks the framework for the next window when a growing sap.m.Table or List grows or a sap.ui.table.Table scrolls - a roundtrip of the framework's own that does NOT call main( ). Sorting and filtering the binding - the column menu of sap.ui.table (sortProperty, filterProperty), a cs_event-binding_call sort or filter - run on the server over ALL rows, and the browser gets the first window of the new order. A cell edited or a row ticked lands in the row of the table it was made in, whatever order the browser showed.", + "Sorters and filters written into the binding info of the view are not applied - the rows arrive in the order the server gives. The app sets that order with t_sort and t_filter: they take effect when they differ from the ones the previous _bind_tab( ) of the table passed, so a view rendered again keeps what the user sorted and filtered in the browser, and a new sort the app passes (from a layout, a dialog) replaces it. Passing an empty table clears it the same way." + ], + "parameters": [ + { + "name": "val", + "type": "data", + "doc": "the table - a public STANDARD table attribute of the app, passed by reference like _bind( ), or a data reference to one (REF #( mt_rows ), or an attribute TYPE REF TO data pointing to the table)." + }, + { + "name": "window", + "type": "i", + "default": "100", + "doc": "the rows the browser gets at a time; at least 1." + }, + { + "name": "t_sort", + "type": "ty_t_bind_tab_sort", + "optional": true, + "doc": "the order of the rows - see above when it applies." + }, + { + "name": "t_filter", + "type": "ty_t_bind_tab_filter", + "optional": true, + "doc": "the rows that show - see above when it applies." + } + ], + "returns": "string" + }, + { + "name": "_bind_tab_row", + "group": "Data binding", + "doc": [ + "The row of a _bind_tab( ) table that a row of the browser shows. The browser holds the rows in the order the server sorted and filtered them, so the index in a binding path an event hands over (`$event.oSource.getBindingContext().getPath()` -> `/MT_ROWS/5`) is a position in THAT order, not the row of the table: row 6 shown may be row 4711 of mt_rows. This answers it - the same order the response was built with. A table that is no window answers row itself." + ], + "parameters": [ + { + "name": "val", + "type": "data", + "doc": "the table, as passed to _bind_tab( ) - the table or a data reference to it." + }, + { + "name": "row", + "type": "i", + "doc": "the position in the browser, counted from 1: the index of the binding path plus 1." + } + ], + "returns": "i" + }, { "name": "follow_up_action", "group": "Events and frontend actions", @@ -1449,6 +1504,60 @@ "label": "do not raise the GLOBAL busy indicator for this wire. The roundtrip" } ] + }, + { + "name": "ty_s_bind_tab_sort", + "doc": [ + "One sorter of _bind_tab( ): the column (the upper-case component name of the row) and the direction. The first sorter that tells two rows apart decides." + ], + "members": [ + { + "name": "path", + "type": "string" + }, + { + "name": "descending", + "type": "abap_bool" + } + ] + }, + { + "name": "ty_t_bind_tab_sort", + "doc": [], + "definition": "STANDARD TABLE OF ty_s_bind_tab_sort WITH EMPTY KEY" + }, + { + "name": "ty_s_bind_tab_filter", + "doc": [ + "One condition of the filter of _bind_tab( ). The conditions of one group are ORed, the groups ANDed - the conditions on one column ORed, the columns ANDed, as UI5 combines a list binding's filters. operator is a sap.ui.model.FilterOperator: EQ NE LT LE GT GE BT NB Contains NotContains StartsWith NotStartsWith EndsWith NotEndsWith; value2 is the upper bound of BT / NB. Numbers, dates (yyyy-MM-dd or yyyyMMdd), times and booleans (true / false) compare as such, text without regard to case." + ], + "members": [ + { + "name": "group", + "type": "i" + }, + { + "name": "path", + "type": "string" + }, + { + "name": "operator", + "type": "string" + }, + { + "name": "value1", + "type": "string" + }, + { + "name": "value2", + "type": "string" + } + ] + }, + { + "name": "ty_t_bind_tab_filter", + "doc": [], + "definition": "STANDARD TABLE OF ty_s_bind_tab_filter WITH EMPTY KEY" } ] } diff --git a/docs/resources/api.md b/docs/resources/api.md index f9f51018..dbbf183a 100644 --- a/docs/resources/api.md +++ b/docs/resources/api.md @@ -27,7 +27,7 @@ may still call, and what to write instead, is on Generated from [`z2ui5_if_client`](https://github.com/abap2UI5/abap2UI5/blob/main/src/02/z2ui5_if_client.intf.abap) -on **main** — 33 methods, 5 constant +on **main** — 35 methods, 5 constant structures. The same reference as one JSON document: [client-api.json](https://abap2ui5.github.io/docs/api/client-api.json). ## App lifecycle @@ -172,6 +172,34 @@ Deliberately ONE parameter. The moment a second is needed - tab / tab_index for Returns `string`. +### `_bind_tab` + +Bind a LARGE table to a list control - the browser gets it a window at a time instead of whole. Returns the value binding like _bind( ) (`items = client->_bind_tab( mt_rows )`); the rows of the template bind relative (`{NAME}`), as with _bind( ). + +The rows stay in the app's attribute. The response carries the first `window` rows, and next to them the window's state under `/__WINDOW/` - TOTAL, the rows the filter lets through, COUNT, the rows sent, and SIZE. The control's list binding knows the full length and asks the framework for the next window when a growing sap.m.Table or List grows or a sap.ui.table.Table scrolls - a roundtrip of the framework's own that does NOT call main( ). Sorting and filtering the binding - the column menu of sap.ui.table (sortProperty, filterProperty), a cs_event-binding_call sort or filter - run on the server over ALL rows, and the browser gets the first window of the new order. A cell edited or a row ticked lands in the row of the table it was made in, whatever order the browser showed. + +Sorters and filters written into the binding info of the view are not applied - the rows arrive in the order the server gives. The app sets that order with t_sort and t_filter: they take effect when they differ from the ones the previous _bind_tab( ) of the table passed, so a view rendered again keeps what the user sorted and filtered in the browser, and a new sort the app passes (from a layout, a dialog) replaces it. Passing an empty table clears it the same way. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `val` | `data` | | the table - a public STANDARD table attribute of the app, passed by reference like _bind( ), or a data reference to one (REF #( mt_rows ), or an attribute TYPE REF TO data pointing to the table). | +| `window` | `i` | `100` | the rows the browser gets at a time; at least 1. | +| `t_sort` | `ty_t_bind_tab_sort` | *optional* | the order of the rows - see above when it applies. | +| `t_filter` | `ty_t_bind_tab_filter` | *optional* | the rows that show - see above when it applies. | + +Returns `string`. + +### `_bind_tab_row` + +The row of a _bind_tab( ) table that a row of the browser shows. The browser holds the rows in the order the server sorted and filtered them, so the index in a binding path an event hands over (`$event.oSource.getBindingContext().getPath()` -> `/MT_ROWS/5`) is a position in THAT order, not the row of the table: row 6 shown may be row 4711 of mt_rows. This answers it - the same order the response was built with. A table that is no window answers row itself. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `val` | `data` | | the table, as passed to _bind_tab( ) - the table or a data reference to it. | +| `row` | `i` | | the position in the browser, counted from 1: the index of the binding path plus 1. | + +Returns `i`. + ## Events and frontend actions ### `_event` @@ -601,4 +629,33 @@ The per-wire options of _event( ) - see the documentation on the method for what | `check_queue_last` | `abap_bool` | | `check_no_busy` | `abap_bool` | +### `ty_s_bind_tab_sort` + +One sorter of _bind_tab( ): the column (the upper-case component name of the row) and the direction. The first sorter that tells two rows apart decides. + +| Field | Type | +|---|---| +| `path` | `string` | +| `descending` | `abap_bool` | + +### `ty_t_bind_tab_sort` + +Defined as `STANDARD TABLE OF ty_s_bind_tab_sort WITH EMPTY KEY`. + +### `ty_s_bind_tab_filter` + +One condition of the filter of _bind_tab( ). The conditions of one group are ORed, the groups ANDed - the conditions on one column ORed, the columns ANDed, as UI5 combines a list binding's filters. operator is a sap.ui.model.FilterOperator: EQ NE LT LE GT GE BT NB Contains NotContains StartsWith NotStartsWith EndsWith NotEndsWith; value2 is the upper bound of BT / NB. Numbers, dates (yyyy-MM-dd or yyyyMMdd), times and booleans (true / false) compare as such, text without regard to case. + +| Field | Type | +|---|---| +| `group` | `i` | +| `path` | `string` | +| `operator` | `string` | +| `value1` | `string` | +| `value2` | `string` | + +### `ty_t_bind_tab_filter` + +Defined as `STANDARD TABLE OF ty_s_bind_tab_filter WITH EMPTY KEY`. +