Hi,
I'm playing around with the datasource of the Kata#4. I tried to get all the data that is available but with the paging option. I noticed the following:
When i just add the ad-hoc source without any filtering etc it wont load all information, so when adding the query filter in between i can't find any data which are in the list which haven't been loaded, which make sense because of the paging.
However when i add an filter in the query itself and taking the info either by hardcoding or an feed it won't find that data. So why is there an paging option?
The other thing i was wondering is what is the (GetNextPageInputArgs args) used for?
Hi Gerwin,
Great questions!
However when i add an filter in the query itself and taking the info either by hardcoding or an feed it won't find that data. So why is there an paging option?
The HasNextPage property of the GQIPage object indicates if there is a next page. If you set this property to true in your ad hoc script, then GQI will call the GetNextPage method once more if he needs more data. This will be done untill the last page (HasNextPage is false) is fetched (if needed).
In Kata#4 we just returned 1 page to GQI indicating that it is the only page available. If you would like to return all the data (in a paged way) to GQI, then you could get 100 rows, set HasNextPage to true and return the page. Since you set HasNextPage to true, GQI will call the method once more, so you can then provide the next 100 satellites, untill all satellites are provided.
Here you can find the lifecycle when a query is build and fetched, this also shows how GetNextPage is used: https://docs.dataminer.services/user-guide/Advanced_Modules/Dashboards_and_Low_Code_Apps/GQI/Extensions/Ad_hoc_data/Ad_hoc_Life_cycle.html
The other thing i was wondering is what is the (GetNextPageInputArgs args) used for?
Currently, it is not used. We provided that argument to the method in order to be future proof. This lets us add information, which we potentially need later, without breaking backwards compatibility.
Let me know if I misunderstood a question or anything is unclear!
Best regards, Ward
Great to hear it worked, that’s indeed the way how it can be done!
Hi Ward,
I just noticed that i made an error in the paging code i wrote:
var satellites = _satellitesHelper.GetSatellites().Skip(_pagingCookie).Take(100);
if (satellites.Count() < 100 || satellites.Count() == 0) { _isnotlastpage=false; }
I forgot to update the _pagingCookie with an updated value so it kept getting the first 100 sats.
It is working now as expected.