Skip to main content
July 24, 2024
Question

Pagination in todatasubset

  • July 24, 2024
  • 19 replies
  • 0 views

Hi Champ,

I have a map variable and the same is used in the table. So I can see it was coded as todatasubset to the map variable with a local defined pagination variable. It's working fine if the map is having less no of rows then pagination ;but getting errorrdout when it's having more rows..message says like "batc size was 0 but te largest column data array had 12 items."

So FYI: We are not using datasubset rather using todatasubset.

Regards,

Ghanashyam

19 replies

stefanhelzle0001
Brainy
July 24, 2024

I do not fully understand. Can you share some code snippets explaining what you are doing?

konduruc733182
July 24, 2024

Please share the code snippet of what you have configured and the error box screenshot if possible. 

July 24, 2024

Please find the error screenshot along with the code snippet

I just put some portion of the code needed to debug this

a!localVariables(
local!paginInfo:a!pagingInfo(
startindex: 1,
batchSize: 10
),
local!mapDataSubset: a!dataSubset(
startIndex:local!paginInfo.startIndex,
batchSize:local!paginInfo.batchSize,
totalCount:count(index(ri!map,"abc",{})),
sort:a!sortInfo(
field:"abc",
ascending:true
),
data:ri!map,
identifiers:index(ri!map,"abc",{})
),
a!gridField(
label: "label",
labelPosition: "ABOVE",
data: local!mapDataSubset,
pagingSaveInto:local!paginInfo

)

stefanhelzle0001
Brainy
July 24, 2024

When creating a data subset using a!datasubset(), you have to make sure that the number of items in "data" matches the batchsize parameter.

July 24, 2024

As I am having pagination in my grid..how can I make it data to be changed dynamically based on pagination?