How to keep data when move pages on TableRecords? -Traditional Web-

I want to update at once all data on a TableRecord.

The TableRecord can edit some fields.


Now I am facing, when move and back the pages input data disappeared.
How should I do to keep the data when move pages?

It is Traditional Web application.


Hi Meg2,

We can use cookies, in order to save the data. Serialize the values into JSON and save the json in the cookie and then when you want you can retrieve the value from the cookie.

Note; When you are assigning the value into the cookie in the application module A, then you  can only retrieve the values again from cookie with in that  module.

Hope this will helps you.

Thanks & Regards,

Koushik

Hi Koushik,

Thank you for your replying.
Unfortunately I am not familiar about JSON and using cookies.
Is there any other way to resolve this by only using outsystems?


Hi Meg2,

You can also keep data in session instead of cookies but you have to do it after converting it to JSON. 

Doing JSON serialize and Deserialize is simple and you just have to use widgets available with same name in widget area.

Solution

Hello Meg2

Let me see if I can understand exactly what you're talking about. 

When you say move and back, are you leaving the actual Web screen, or are you talking about the Table Records pagination? 

In the first case, you have few options, and the one with probably less impact in performance, depending on the number of records you are changing, is to create/update them in database before leaving the Web screen. 

If it is the second case, the list of the TableRecords will be reset when you change the TableRecords page. This means you can't store your info in it. A possible solution is to update the data in database immediately after changing it in your inputs. 

Other solution is to keep a separate local list that you use as source of the TableRecords and you update this list using the aggregate when moving pages, but do not update records that were changed by the user, updating manually the Start Index in the TableRecords. This one will make your page not have to access database all the time, but as the user moves through TableRecords pages the page will become more and more slower, as it will need to keep in memory (and viewstate) all this info. 

So, in reality, all options are bad, but I prefer to update everything in database immediately or when the user changes TableRecords page, for example... 

Cheera

Solution

Hi Eduardo,

My case is second one. I understand my possible solution.

I'll do your suggestion.


Thank you all.