106
Views
4
Comments
Large Local Variable in ViewState - I need help to solve this issue
Question

Hi There,

I am developing a web application, There I have a list widget with search functionality. Data is from API, For each search i need to send the search values to the api, to get the updated list.

Actually I used one local list variable. This variable is the  source for the list records widget.

For filters, I used one screen action and call the API with search parameters and assign that updated list into local variable.

But architecture dashboard suggests that, we should not use large variables or preparation items in screen action. That will cause heavy load in View State.


How can I fix this, without using local variable for search ??


below is the search filters FYI.


Hi! 

Why can not you use the output list from the API as the source of the list widget? 

stay safe 

Graça

mvp_badge
MVP
Rank: #19

Hi Aravind,

So for Traditional Web Apps Viewstate should be kept small for performant pages.

You can check the view state of each page easily by installing OutSystemsLaucher extension in Chrome web browser. So that way you can easily check if you are in "trouble".

Read this forum post with detailed information about view state. There is also a nice article from OutSystems MVP Justin James regarding view state.

Regards,

Daniel

Rank: #605

Aravind M wrote:

Hi There,

I am developing a web application, There I have a list widget with search functionality. Data is from API, For each search i need to send the search values to the api, to get the updated list.

Actually I used one local list variable. This variable is the  source for the list records widget.

For filters, I used one screen action and call the API with search parameters and assign that updated list into local variable.

But architecture dashboard suggests that, we should not use large variables or preparation items in screen action. That will cause heavy load in View State.


How can I fix this, without using local variable for search ??


below is the search filters FYI.


Hi Aravind,

We had plenty of information in our documentation repository about this scenario.

You can take a look or search at Best Practices topics (https://success.outsystems.com/Documentation/Best_Practices/Performance)


In advance, I can give you a tip :-)


https://success.outsystems.com/Documentation/Architecture_Dashboard/Code_Patterns/Best_practices/Optimize_data_preparation

https://success.outsystems.com/Documentation/Architecture_Dashboard/Code_Patterns/Best_practices/Don't_abuse_scope_information?origin=d


Regards


mvp_badge
MVP
Rank: #74

Hi Aravind,

In addition to the already mentioned information. I have used Performance CSI in the past to troubleshoot ViewState issues. I would recommend it.

Regards,

Nordin