Hi,
while working with TECHMOBILE
WO-list loading performance optimization we have decided to limit the default page size fetched from the server at once. I was able to do that but I made an interesting discovery along the way which I cannot see documented anywhere.
Namely according to the official MAF Components documentation the default page-size
is 50
and yet if you analyze the web request then you can see oslc.pageSize=100
in the actual request.
It made me wonder why is that and I stumbled opon following function in the @maximo/maximo-js-api
module, which applications depend on.
/**
* Returns the size of the fetch window based on the passed in page size. A fetch window is typically a multiple of the page size where
* we fetch/load more data than we need in a page, to make paging operations perform better.
*
* @param {number} size - The page size.
*
* @returns {number} Fetch window size.
*/
getFetchPageSize(size) {
// if we are only loading a single item, then just load a single item.
if (size === 1) return size;
if (this.options.exactPageSize) return size;
// we always try to load more data that our page/window size
let fetchWindowSize = size * 2;
// but, if the data is being requesting is more that 100 then we'll just whatever the window size is
if (fetchWindowSize > 100) {
fetchWindowSize = size;
}
return fetchWindowSize;
}
The function comments speak for themselves and it's not my point to question the logic.
The real question is whether there is any declarative way (app.xml
) to somehow configure this.options.exactPageSize
value in runtime for a specific data source and instruct the framework to use explicitly given page-size
attribute value?
If there is no declarative way then what would be the right way of doing this for the standard TECHMOBILE
application dswolist
data set in JavaScript?
NOTES:
- Of course I can do the math myself and knowing the underlying logic I can provide the value which will match my expectations, but this arbitrarily defined threshold of
100
worries me "a bit". I would rather prefer to have solid control of the actual page size used when querying Maximo.
-
Version:
* Graphite build version: 2.13.567
* Configuration version: 9.0.4
Feedback is highly appreciated! Thanks!