Simple List widget with pagination

Gaetano De Mitr
ServiceNow Employee
ServiceNow Employee

Hi guys,

How Can insert pagination on Simple List Widget ?

Thanks,

9 REPLIES 9

Good Morning,

His referring to the attached zip file "sp_widget_b73f78fadb7783000c0a361b7c961944.xml.zip" in his post above, the hyperlink is just a guide on how to import\export xml files, the xml is inside the zip.

I got the widget working but it means you can't display more than 5 records at a time.

Kind Regards

Ashley

charliesdev
Giga Expert

I'm about to try this myself.  Did you have any luck?

davidbilla
Tera Contributor

Hi Vinay Reddy,

 

Thanks for the code. it works like a charm.

I am using 2 simple lists in the same page, whenever i navigate through in widget A the same navigation happens in the widget B which is untouched.

Is there any fix for this.

 

Thanks in Advance.

Surendra Poosa1
Kilo Expert

I have tried this ...but did not work. We are on London version. Do we need to make any changes to make it work?

Mwatkins
ServiceNow Employee
ServiceNow Employee

Heads up, when using chooseWindow to introduce pagination you should also use setNoCount() to avoid an extra query. GlideRecord.chooseWindow causes GlideRecord to count all the records that match your query filter. You can avoid that extra query by using setLimit first.

 

See https://www.servicenow.com/community/developer-blog/optimizing-pagination-in-gliderecord-with-choose...

 

Please Correct if this solves your issue and/or 👍 if Helpful

"Simplicity does not precede complexity, but follows it" - Alan Perlis