233
Views
9
Comments
Solved
How can List Widget display only part of a list
Question

I got a list with 30 items , can i choose to display only 10 of them in the list widget? or i have to create another list and display the new list instead.

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi yuval,

it sounds like you are struggling with very basic things, it is a very common thing to only want data that fits a certain filter, and it is a very common thing to want to show only chunks of information to the end user at a time.  

It sounds like you are trying to invent your own way of doing this with listfilters after retrieving lists, and than even other local lists to only take chunks of that listfilter result to show to the user.  All of this might maybe be needed in specific uses cases, but if your data is in a database, please just scaffold a list screen and take a look at what is in there : 

- filters and sorting are applied inside the aggregate, not afterwards

- pagination is also showcased in the scaffolded list screen

If your data is not from the database (like some external api that doesn't offer pagination) than please read this excellent article by Kilian.

Dorine

2023-04-07 07-55-02
Krushna Mantri

Hi Yuval,


If you are using the Traditional web List widget then there is an option as Linecount, and if you are using Reactive web then the OutSystems don't have the LineCount option so there are multiple ways to show only 10 items

that is: 1) either send only 10 items in the Source List of List Widget

2) or add one condition for List Item as SourceList.CurrentRowNumber < 10

Hope it helps you

Regards,

Krushna

UserImage.jpg
Yuval

Hey , thank you its reactive web, i got a list variable allProducts i dont want to change it , i just want to show 10 items from it , where can i add a condition? there is a list widget and inside of it there is a block that will be display for each item. i want to display only the first 10 items and not the all list .

2021-06-03 11-03-21
Anubhav Rai

Hi Yuval twina,

You can use filters in your aggregate, according to your requirement.
If you want a random 10 then use the max record property set to 10.
Or if you want any specific 10 records then you can add a new attribute in your entity to differentiate 10 records from others (Like you can use IsActive attribute).


Please let me know if you have more queries.

Regards,

2025-02-10 17-24-13
Arun Rajput

Hi Yuval,

Can you please explain your requirement that why you only want to display 10 records?

Is it like that you want 10 records at a time or next 10 after click on the pagination or it is fixed only 10 will show.

UserImage.jpg
Yuval

Hi , i just want to know how can i choose how many items to display with the widget and not from the aggregate

2025-02-10 17-24-13
Arun Rajput

List widget doesn't provide this feature but yes you can achieve this using foreach widget.

Just set startIndex or max item in foreach widget and append those items in another list variable and show them inside list .

UserImage.jpg
Yuval

Thank you , that what i did i wondered if there is a better way 

2023-10-27 12-06-14
Asiyah Munawwar

Hi Yuvan,

If your list is coming from the aggregate, u can set max record for 10 records but if you have a list then you have to append the elements of the list to a new list setting iteration to 10.

Hope this will help u.

Thanks  

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi yuval,

it sounds like you are struggling with very basic things, it is a very common thing to only want data that fits a certain filter, and it is a very common thing to want to show only chunks of information to the end user at a time.  

It sounds like you are trying to invent your own way of doing this with listfilters after retrieving lists, and than even other local lists to only take chunks of that listfilter result to show to the user.  All of this might maybe be needed in specific uses cases, but if your data is in a database, please just scaffold a list screen and take a look at what is in there : 

- filters and sorting are applied inside the aggregate, not afterwards

- pagination is also showcased in the scaffolded list screen

If your data is not from the database (like some external api that doesn't offer pagination) than please read this excellent article by Kilian.

Dorine

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.