Need sorting without Paginginfo

Hi ,

 

I have list of year in drop down which i want to sort without using paging info function ?

 

Can we do that ? 

 

 

 

  Discussion posts and replies are publicly visible

Parents
  • Here is my suggested answer based on your restriction not to make change in source of data, or any other objects.
    =========================================
    create a rule named getYearObject

    code....
    {year:ri!year}

    input...
    year (number integer)
    =========================================
    create a parent rule named getYearObjectArray

    code...
    a!foreach(
    items:ri!years,
    expression:rule!getYearObject(fv!item)
    )

    input...
    years (number integer) multiple
    =========================================
    In your master rule write below code.
    For understanding I am writing code step by step.

    local!yearDummyData:{2011,2012,2002,2014},
    local!pagingInfo:a!pagingInfo(startIndex:1, batchSize:-1 sort: a!sortInfo(field: "year",ascending: true()))
    local!yearObjects:rule!getYearObjectArray(years:local!yearDummyData),
    local!sortedYears:todatasubset(local!yearObjects,local!pagingInfo),
    local!answer:index(local!sortedYears.data,"year",{})

    Hope this works as standalone code.

    Regards,
    Mayur Mondhe

  • sort() function is working now. But order is coming descending. On that need to work. Can we make true false for that also in sort function ?
Reply Children