Pagination Arrow in Paging Grid

Hello, 

I have a grid field with paginginfo(1,20) and for large datasets in paging grid the back arrow does not seem to work. However, the next arrow works and we are able to fetch the next dataset with no issues. Any insight is appreciated.

Please find the attached snippet that I have  so far: 

 

=load(
  local!dataSubset : a!dataSubset(
    startIndex: 1,
    batchSize: 1,
    data: {},
    totalCount: 0
  ),
  local!expDataSubset: a!dataSubset(
    startIndex: 1,
    batchSize: 1,
    data:{},
    totalCount: 0
  ),
  local!expdPagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 20
  ),
  local!pagingInfo:a!pagingInfo(
    startIndex: 1,
    batchSize: -1
  ), 
    local!rowData,
    local!selectedRows,
    local!singleLineFlag,
    local!selectedTierValue:"Tier 1",
    local!selectedReasonCode,
    local!selectedFeeReasonCode,
    local!expediteFee,
    local!carbonCopy,
  local!selectedYesNo:null,
  local!partialQuantity,
  local!initiatorComments,
  local!expediteData,
  local!apiErrorMessage,
  local!apiResult,
  local!orderNumber,
  local!gridDataSubset:null,
  local!gridSelection: a!gridSelection(
    pagingInfo: a!pagingInfo(
      startIndex: 1,
      batchSize: 20,
      sort:a!sortInfo(
        field:"line_id"
      )
    ),
    selected: {}
  ),
with(
  local!datasubset: if(isnull(local!orderNumber),{},rule!EXP_GetExpdOrderLinesByOrdNum(ri!orders.order_number,local!gridSelection.pagingInfo)),
  a!formLayout(
  label: "Initiate Expedite",
  contents: {
    a!textField(
      label: "Order Number",
      labelPosition: "ADJACENT",
      /*instructions: "Please enter an Order Number to proceed!",*/
      value: ri!orders.order_number,
      saveInto: ri!orders.order_number,
      refreshAfter: "UNFOCUS",
      required: true,
      requiredmessage: "Value for Order Number is required"
      /*validations: a!validationMessage(*/
        /*message:"Please enter an Order Number to Proceed",*/
        /*validateAfter: "REFRESH",*/
        /*showWhen: isnull(ri!orders.order_number)*/
      /*)*/
    ),
    /*a!textField(*/
      /*label:"Check Value",*/
      /*value:local!dataSubset,*/
      /*readOnly:true()*/
    /*),*/
    a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(
          label: "Search",
          saveInto: {
            /*a!save(local!dataSubset,rule!EXP_GetExpdOrderLinesByOrdNum(ri!orders.order_number,local!pagingInfo)),*/
            a!save(local!expDataSubset,rule!EXP_GetExpeditedLines(local!expdPagingInfo,ri!orders.order_number)),
            a!save(local!orderNumber,ri!orders.order_number)
          },
          style: "NORMAL",
          disabled: isnull(ri!orders.order_number)
        )
      },
      secondaryButtons: {}
    ),
    a!gridField(
      label: "Expedite Line Section",
        totalCount: if(local!datasubset.totalCount=0,1,local!datasubset.totalCount),
        emptyGridMessage: "Please enter a valid number order number to search for eligible lines ",
        columns: {
        a!gridTextColumn(
          label:"Line Number",
          field:"line_number",
          data:index(local!datasubset.data,"line_number","")
        ),
         a!gridTextColumn(
          label:"Order Number",
          field:"order_number",
          data:index(local!datasubset.data,"order_number","")
        )
      },
        identifiers:index(local!datasubset.data, "line_id" ,  "{}"),
      value: local!gridSelection,
          saveInto: {
            local!gridSelection,
            a!save(
              local!rowData,
              index(local!datasubset.data,
              wherecontains(
      local!gridSelection.selected,
      local!datasubset.identifiers
    ),{})
            )
          },
       showWhen: if(index(local!datasubset,"totalCount","") >0,true(),false()),
       selection:if(index(local!datasubset,"totalCount","") >0,true,false)
    ),
    a!sectionLayout(
      label:"Single Line Request",
      contents: {
    a!columnsLayout(
      columns: {
        a!columnLayout(
          contents: {
            a!textField(
            label: "Line Number",
              value: local!rowData.line_number,
              readOnly: true
            ),
            a!textField(
              label: "Order Number",
              value: local!rowData.order_number,
              readOnly: true
            ),
            
             a!textField(
             label: "Quantity",
              value: local!rowData.quantity,
              readOnly: true
            ),
             /*a!dropdownField(*/
              /*label:"Tier Value",*/
              /*placeholderLabel: "--- Select Tier Value ---",*/
              /*choiceLabels: index(rule!EXP_GetEBSLookupValuesbyCode("PANDUIT_EXPEDITE_TIERS"),"meaning",null),*/
              /*choiceValues: rule!EXP_GetEBSLookupValuesbyCode("PANDUIT_EXPEDITE_TIERS"),*/
              /*value:local!selectedTierValue,*/
              /*saveInto: local!selectedTierValue,*/
              /*required: true()*/
            /*),*/
              a!dropdownField(
              label:"Reason Code",
              placeholderLabel: "--- Select a Reason Code ---",
              choiceLabels: index(rule!EXP_GetEBSLookupValuesbyCode("PANDUIT_EXPEDITE_REASONS"),"meaning",null),
              choiceValues: rule!EXP_GetEBSLookupValuesbyCode("PANDUIT_EXPEDITE_REASONS"),
              value:local!selectedReasonCode,
              saveInto: local!selectedReasonCode,
              required: true()
            ),
            a!textField(
              label: "Expedite Fee",
              value: local!expediteFee,
              saveInto: local!expediteFee
            ),
               a!dropdownField(
              label:"Fee Reason",
              placeholderLabel: "--- Select a Reason Code ---",
              choiceLabels: index(rule!EXP_GetEBSLookupValuesbyCode("PANDUIT_EXPEDITE_FEE_REASONS"),"meaning",null),
              choiceValues: rule!EXP_GetEBSLookupValuesbyCode("PANDUIT_EXPEDITE_FEE_REASONS"),
              value:local!selectedFeeReasonCode,
              saveInto: local!selectedFeeReasonCode
            )
          }
        ),
        a!columnLayout(
          contents: {
           
            a!textField(
              label: "Carbon Copy",
              value: local!carbonCopy,
              saveInto: local!carbonCopy
            ),
            a!textField(
              label: "Current Scheduled Date",
              value: local!rowData.schedule_ship_date,
              readOnly: true
            ),
            a!textField(
              label:"Request Date",
                value:local!rowData.request_date,
                readOnly: true()
            )
          }
        )
      }
    )
  },
  showWhen: if(or(isnull(local!rowData),or(length(local!gridSelection.selected)=0,length(local!gridSelection.selected)>1)),false,true)
    )
          
  }
)
)
)

Thanks,

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    A Score Level 2
    in reply to bpmnewb
    Hi BPMNewB

    I see that you code looks fine.
    Here are the points to debug.
    Please Update this piece of code
    label: "Order Number"&local!gridSelection.pagingInfo,
    Now Test the interface, Please check when the form loads, I beleive no data will be displayed
    User will enter some number in Order Number field and clicks on search.
    Now the grid will display, and you can see that the label field displays data with local!gridSelection.pagingInfo.
    Once you click on the ">", you can see that the startIndex will change to 21 and the batch size remains 20.
    Now Click on the "<", You should see that the startIndex should change to 1 and the batchSize remains 20.


    Also I have a curios doubt, if you are not using local!expDataSubset for displaying purpose then why are saving the data into this variable in
    the piece of code
    a!save(local!expDataSubset,rule!EXP_GetExpeditedLines(local!expdPagingInfo,ri!orders.order_number)),
  • 0
    Certified Lead Developer
    in reply to bpmnewb
    In your code, why have you made the totalCount as 1?