Question on how to persist paging info

Persist Paging Info:

Hi All,

I am trying to persist paging Info so that when User comes back to that page, we can get on the same page of the grid. But it is always showing the default values of first page. Can you please guide how can I fix it?

Thanks

OriginalPostID-201229

OriginalPostID-201229

  Discussion posts and replies are publicly visible

Parents
  • Hey Philb/ Sikhivahans,

    I am trying for approach 1 only but it is not working for me. Below is the sample code I am trying:

    =load(
    local!documentAssetId:ri!documentAssetID,
    local!documentGridPagingInfo: if(rule!APN_isEmpty(ri!pagingInfo),a!pagingInfo(
    startIndex:1,
    batchSize:5,
    sort:{a!sortInfo(
    field:"docID",
    ascending:true
    ),
    a!sortInfo(
    field:"ID",
    ascending:true
    )
    }
    ),ri!pagingInfo) ,
    local!tempSel,
    local!GridSelectionInfo: a!gridSelection(
    pagingInfo:local!documentGridPagingInfo,
    selected:if(isnull(local!Id),local!tl,local!Id)

    ),
    local!allRecord:rule!rule1,
    local!allDatasubset:todatasubset(local!allRecord,topaginginfo(1,-1)),
    local!selectedDocumentIndex:if(not(fn!isnull(local!Id)),lookup(index(local!allRecord,"ID",{}),local!Id) ,null),
    with(
    local!AllInfo:todatasubset(local!allRecord,local!GridSelectionInfo.pagingInfo),
    local!PAsMissingAttrAssetIds:rule!rule2(index(local!AllInfo.data,"assetID",{0})),
    {

    a!sectionLayout(
    label:"Business Identifier Information",
    firstColumnContents:{ rule!PDIM_SAIL_ShowIdentifiersGrid(ri!identifierDetails)}),

    a!sectionLayout(
    label:"Documents",
    firstColumnContents:{



    a!gridField(

    label:"",
    totalCount:local!AllInfo.totalCount,
    columns:{
    a!gridTextColumn(
    label:"A ID",
    field:"ID",
    data:index(local!AllInfo.data,"ID",{})
    ),

    a!gridTextColumn(
    label:"TID",
    field:"dTID",
    data:index(local!AllInfo.data,"dTID",{})
    ),

    a!gridTextColumn(
    label:"Desc",
    field:"dDesc",
    data:index(local!AllInfo.data,"dDesc",{})
    ),

    a!gridImageColumn(
    label: "Attributes",
    field:"ID",
    data:fn!apply(rule!rule3,index(local!AllInfo.data,"ID",{}), index(local!MissingIds,"ID",{0})),
    size: "ICON"
    )
    },
    identifiers:index(local!AllInfo.data,"ID",{}),
    value:local!GridSelectionInfo,
    saveInto:{
    local!GridSelectionInfo,
                                             a!save(ri!pagingInfo, local!GridPagingInfo),
    a!save(local!dId,index(save!value, "selected", null)),
    a!save(local!selectedIndex, lookup(index(local!AllInfo.data,"ID",{}),index(save!value, "selected", null)))
    },
    selection:true,
    disabled:ri!gridDisabled,
    validations: if(ri!missing,"missing","")

    )
    }
    )
    }
    )

    )
Reply
  • Hey Philb/ Sikhivahans,

    I am trying for approach 1 only but it is not working for me. Below is the sample code I am trying:

    =load(
    local!documentAssetId:ri!documentAssetID,
    local!documentGridPagingInfo: if(rule!APN_isEmpty(ri!pagingInfo),a!pagingInfo(
    startIndex:1,
    batchSize:5,
    sort:{a!sortInfo(
    field:"docID",
    ascending:true
    ),
    a!sortInfo(
    field:"ID",
    ascending:true
    )
    }
    ),ri!pagingInfo) ,
    local!tempSel,
    local!GridSelectionInfo: a!gridSelection(
    pagingInfo:local!documentGridPagingInfo,
    selected:if(isnull(local!Id),local!tl,local!Id)

    ),
    local!allRecord:rule!rule1,
    local!allDatasubset:todatasubset(local!allRecord,topaginginfo(1,-1)),
    local!selectedDocumentIndex:if(not(fn!isnull(local!Id)),lookup(index(local!allRecord,"ID",{}),local!Id) ,null),
    with(
    local!AllInfo:todatasubset(local!allRecord,local!GridSelectionInfo.pagingInfo),
    local!PAsMissingAttrAssetIds:rule!rule2(index(local!AllInfo.data,"assetID",{0})),
    {

    a!sectionLayout(
    label:"Business Identifier Information",
    firstColumnContents:{ rule!PDIM_SAIL_ShowIdentifiersGrid(ri!identifierDetails)}),

    a!sectionLayout(
    label:"Documents",
    firstColumnContents:{



    a!gridField(

    label:"",
    totalCount:local!AllInfo.totalCount,
    columns:{
    a!gridTextColumn(
    label:"A ID",
    field:"ID",
    data:index(local!AllInfo.data,"ID",{})
    ),

    a!gridTextColumn(
    label:"TID",
    field:"dTID",
    data:index(local!AllInfo.data,"dTID",{})
    ),

    a!gridTextColumn(
    label:"Desc",
    field:"dDesc",
    data:index(local!AllInfo.data,"dDesc",{})
    ),

    a!gridImageColumn(
    label: "Attributes",
    field:"ID",
    data:fn!apply(rule!rule3,index(local!AllInfo.data,"ID",{}), index(local!MissingIds,"ID",{0})),
    size: "ICON"
    )
    },
    identifiers:index(local!AllInfo.data,"ID",{}),
    value:local!GridSelectionInfo,
    saveInto:{
    local!GridSelectionInfo,
                                             a!save(ri!pagingInfo, local!GridPagingInfo),
    a!save(local!dId,index(save!value, "selected", null)),
    a!save(local!selectedIndex, lookup(index(local!AllInfo.data,"ID",{}),index(save!value, "selected", null)))
    },
    selection:true,
    disabled:ri!gridDisabled,
    validations: if(ri!missing,"missing","")

    )
    }
    )
    }
    )

    )
Children
No Data