How to display all the data within the same page

How to display all the data within the same page

  

Hi,

From the example below, when user click on the view more phones, i need to refresh the page and load all the phone availables on the same page, how can i do about this? 

So far i have tried to create new screen action, to set the category = "Phones" and then refresh data and then refresh the table but it doesn't work.

Phones

1
Iphone 8
2
Samsung S8
3
Sony




                         Click here to view more phones

Furniture

1
Sofa
2
Table
3
Chairs


So when you click here to view more phones, it will display the following on the same pages. The furniture will be hidden

1
Iphone 8
2
Samsung S8
3
Sony
4
Xiao mi
5
Hua Wei
6
Nokia



Hi,

Did you follow the courses?

This is really basic stuff and it seems your are struggling with it so I really wonder if you have followed the online--course.

https://www.outsystems.com/learn/paths/2/becoming-a-web-developer/


if you did follow the course, I really wonder if there was something missing in the course or unclear.

Could you enlighten us with what is missing in those course if you did follow it all.





J. wrote:

Hi,

Did you follow the courses?

This is really basic stuff and it seems your are struggling with it so I really wonder if you have followed the online--course.

https://www.outsystems.com/learn/paths/2/becoming-a-web-developer/


if you did follow the course, I really wonder if there was something missing in the course or unclear.

Could you enlighten us with what is missing in those course if you did follow it all.





Hi J,

Yes, i have followed the outsystem online course for beginner only. 


I understand that we could use web block to update part of the page but i do not want to use that approach. 





Yes you don't need to use web block.... you can use table or form or container then do ajax refresh to refresh the list make sure the method is ajax not submit. I need more details on which part you are having the problems with.

hi jace,

If you want to hide the furniture table records, just set its extended properties to ""display:none;"", and to "" conversely. Here I use local variable of type text to enable furniture display when not all phones are shown, and to hide it when all phones are displayed.

The logic is still the same, use the preparation for the aggregate, refresh the data, and then use ajax refresh, with addition to assign the hidden_style variable properly:

regards,

bb

Solution

Hello Jace,

J. has a point.
You need to digger deep in the online courses and documentation.

Anyway, to do what you want, you need to observe the following:

1. If you want to change between showing many tables or a single one, depending on users choice, you need to implement some control to allow this happen.

From top of my head, I would use a single variable, of type Text or some Static Entity that allows me to identify if I want to show a single table (an identifier to this table, like its name) or if I want to show all of them. If you want to keep the value between pages (you are using submit), you must use a Session variable. If not (you are using ajax submit), you can use a local variable.

To show or not a table (based on the value of this variable, I would use IF's in the screen, with the condition on each one: 

variable = "" or variable = "my identifier for this table"

2. Refreshing the chosen table.

Your table in the screen, either a Table Records or a List Records, has a property that tells the number of lines it should show. So, when refreshing the table, you need to change this number. 0 will show all the items (usually bad practice).

Here I have an example (done fast, so it is just to give you some ideas): https://eduardojauch.outsystemscloud.com/ShowingVariableLenghtTable/HomeScreen.aspx

The oml is attached.

Keep studying.

Cheers,
Eduardo Jauch

Solution

Hi Eduardo,

Thanks for helping. I got the solution. 

Yes definitely will try to learn/study more for outsystem.

It is getting more interesting. :P