Data only populates after clicking custom pagination arrow

Hello,

I am troubleshooting an issue I have with a GRID where there is no data populating the GRID when I load the page but after clicking one of the custom pagination arrows we have, the data populates but then we can't click the arrow to go to the next page of data. There are quite a few files involved in this screen but I suspect the issue has to do with paging?

On page load:

After clicking custom pagination arrow:

GRID code:

a!localVariables(
  local!pagingInfo,
  {
    rule!TB_SEC_customPaginationComponent(
      startIndex: ri!pagingInfo.startIndex,
      batchSize: cons!TB_INT_TRADE_BATCH_SIZE,
      totalCount: ri!totalCount,
      saveExpression: {
        a!save(
          local!pagingInfo,
          a!pagingInfo(
            startIndex: if(
              a!isNullOrEmpty(ri!pagingInfo.startIndex),
              0,
              ri!pagingInfo.startIndex
            ),
            batchSize: cons!TB_INT_TRADE_BATCH_SIZE,
            sort: ri!pagingInfo.sort
          )
        ),
        a!save(ri!pagingInfo, local!pagingInfo),
        a!save(
          ri!fcaReportDetails,
          todatasubset(
            rule!TB_RULE_castToFcaReportCdt(
              data: rule!TB_SP_executeSQlStatement(
                sqlStatement: rule!TB_RULE_generateSQLStatementForFcaReport(
                  podCode: ri!podCode,
                  orderId: ri!orderId,
                  vertInvestmentDesc: ri!vertInvestmentDesc,
                  tradeQuantity: ri!tradeQuantity,
                  execPrice: ri!execPrice,
                  ccy: ri!ccy,
                  principalAmount: ri!principalAmount,
                  usdRate: ri!usdRate,
                  gbpRate: ri!gbpRate,
                  usdValue: ri!usdValue,
                  bbTicker: ri!bbTicker,
                  vertAssetType: ri!vertAssetType,
                  vertTraderCode: ri!vertTraderCode,
                  vertExecSide: ri!vertExecSide,
                  pagingInfo: ri!pagingInfo
                )
              )
            )
          )
        )
      }
    ),
    a!gridLayout(
      label: "",
      labelPosition: "COLLAPSED",
      headerCells: {
        a!forEach(
          items: cons!TB_TXT_COLUMN_LIST_FOR_FCA_REPORT,
          expression: a!gridLayoutHeaderCell(label: fv!item, align: "CENTER")
        )
      },
      columnConfigs: {
        a!gridLayoutColumnConfig(width: "DISTRIBUTE")
      },
      rows: {
        a!forEach(
          items: ri!fcaReportDetails.data,
          expression: a!localVariables(
            local!rowData: fv!item,
            {
              a!gridRowLayout(
                id: fv!item.id,
                contents: {
                  a!forEach(
                    items: cons!TB_TXT_FIELDS_LIST_FOR_FCA_REPORT,
                    expression: a!textField(
                      readOnly: true(),
                      align: "CENTER",
                      label: {
                        cons!TB_TXT_COLUMN_LIST_FOR_FCA_REPORT[wherecontains(
                          fv!item, cons!TB_TXT_FIELDS_LIST_FOR_FCA_REPORT
                        )]
                      },
                      value: index(local!rowData, fv!item, null())
                    )
                  )
                },
                selectionDisabled: true()
              )
            }
          )
        )
      },
      shadeAlternateRows: true(),
      spacing: "DENSE"
    ),
    rule!TB_SEC_customPaginationComponent(
      startIndex: ri!pagingInfo.startIndex,
      batchSize: cons!TB_INT_TRADE_BATCH_SIZE,
      totalCount: ri!totalCount,
      saveExpression: {
        a!save(
          local!pagingInfo,
          a!pagingInfo(
            startIndex: if(
              a!isNullOrEmpty(ri!pagingInfo.startIndex),
              0,
              ri!pagingInfo.startIndex
            ),
            batchSize: cons!TB_INT_TRADE_BATCH_SIZE,
            sort: ri!pagingInfo.sort
          )
        ),
        a!save(ri!pagingInfo, local!pagingInfo),
        a!save(
          ri!fcaReportDetails,
          todatasubset(
            rule!TB_RULE_castToFcaReportCdt(
              data: rule!TB_SP_executeSQlStatement(
                sqlStatement: rule!TB_RULE_generateSQLStatementForFcaReport(
                  podCode: ri!podCode,
                  orderId: ri!orderId,
                  vertInvestmentDesc: ri!vertInvestmentDesc,
                  tradeQuantity: ri!tradeQuantity,
                  execPrice: ri!execPrice,
                  ccy: ri!ccy,
                  principalAmount: ri!principalAmount,
                  usdRate: ri!usdRate,
                  gbpRate: ri!gbpRate,
                  usdValue: ri!usdValue,
                  bbTicker: ri!bbTicker,
                  vertAssetType: ri!vertAssetType,
                  vertTraderCode: ri!vertTraderCode,
                  vertExecSide: ri!vertExecSide,
                  pagingInfo: ri!pagingInfo
                )
              )
            )
          )
        )
      }
    )
  }
)


Custom pagination code:
if(
  ri!batchSize > ri!totalCount,
  a!richTextDisplayField(
    align: "RIGHT",
    value: a!richTextItem(
      text: ri!totalCount & " items",
      style: "STRONG",
      size: "STANDARD"
    )
  ),
  {
    a!columnsLayout(
      columns: {
        a!columnLayout(contents: {}),
        a!columnLayout(contents: {}),
        a!columnLayout(
          contents: {
            a!sideBySideLayout(
              items: {
                a!sideBySideItem(
                  item: a!stampField(
                    labelPosition: "COLLAPSED",
                    icon: "angle-double-left-bold",
                    backgroundColor: if(ri!startIndex = 1, "SECONDARY", "ACCENT"),
                    link: if(
                      ri!startIndex = 1,
                      {},
                      a!dynamicLink(
                        saveInto: {
                          a!save(ri!startIndex, 1),
                          ri!saveExpression
                        }
                      )
                    ),
                    size: "TINY"
                  ),
                  width: "MINIMIZE"
                ),
                a!sideBySideItem(
                  item: a!stampField(
                    labelPosition: "COLLAPSED",
                    icon: "angle-left-bold",
                    backgroundColor: if(ri!startIndex = 1, "SECONDARY", "ACCENT"),
                    link: if(
                      ri!startIndex = 1,
                      {},
                      a!dynamicLink(
                        saveInto: {
                          a!save(
                            ri!startIndex,
                            ri!startIndex - ri!batchSize
                          ),
                          ri!saveExpression
                        }
                      )
                    ),
                    size: "TINY"
                  ),
                  width: "MINIMIZE"
                ),
                a!sideBySideItem(
                  item: a!richTextDisplayField(
                    align: "CENTER",
                    labelPosition: "COLLAPSED",
                    value: {
                      a!richTextItem(
                        text: " " & ri!startIndex & " - " & if(
                          ri!startIndex + ri!batchSize > ri!totalCount,
                          ri!totalCount,
                          ri!startIndex + ri!batchSize - 1
                        ) & " of " & ri!totalCount,
                        size: "MEDIUM",
                        style: "STRONG"
                      )
                    }
                  )
                ),
                a!sideBySideItem(
                  item: a!stampField(
                    labelPosition: "COLLAPSED",
                    icon: "angle-right-bold",
                    backgroundColor: if(
                      ri!startIndex + ri!batchSize > ri!totalCount,
                      "SECONDARY",
                      "ACCENT"
                    ),
                    link: if(
                      ri!startIndex + ri!batchSize > ri!totalCount,
                      {},
                      a!dynamicLink(
                        saveInto: {
                          a!save(
                            ri!startIndex,
                            ri!startIndex + ri!batchSize
                          ),
                          ri!saveExpression
                        }
                      )
                    ),
                    size: "TINY"
                  ),
                  width: "MINIMIZE"
                ),
                a!sideBySideItem(
                  item: a!stampField(
                    labelPosition: "COLLAPSED",
                    icon: "angle-double-right-bold",
                    backgroundColor: if(
                      ri!startIndex + ri!batchSize > ri!totalCount,
                      "SECONDARY",
                      "ACCENT"
                    ),
                    link: if(
                      ri!startIndex + ri!batchSize > ri!totalCount,
                      {},
                      a!dynamicLink(
                        saveInto: {
                          a!save(
                            ri!startIndex,
                            if(
                              mod(ri!totalCount, ri!batchSize) = 0,
                              ri!totalCount - ri!batchSize + 1,
                              ri!totalCount - mod(ri!totalCount, ri!batchSize) + 1
                            )
                          ),
                          ri!saveExpression
                        }
                      )
                    ),
                    size: "TINY"
                  ),
                  width: "MINIMIZE"
                ),
                
              },
              alignVertical: "MIDDLE",
              spacing: "SPARSE"
            )
          }
        )
      }
    )
  }
)

There is more code involved, but I suspect the issue is between these 2 files. We are getting the data from a stored procedure and I have confirmed that the SQL statement is properly retrieving the data. The reason I suspect the issue might be related to the pagination is because of the data populating after clicking the pagination arrow.

Any insight or help with this would be much appreciated. I can provide more code if discussion warrants it.

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply Children