Why are there two occurrences of the viewstate in the page (when inspecting the html)?
VIEWSTATE is the asp.net implementation of the view state, _OSVSTATE is the OutSystems implementation, to prevent messing each other up I presume OutSystems has its own implementation which runs after the the ASP processor.
Wim van den Brink wrote:
Sorry for not getting into the specifics, but basically there's a hidden variable at the end of the page:<input type="hidden" name="__OSVSTATE" id="__OSVSTATE" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />and then via $(document).ready the variable is loaded with the exact same content:<script type="text/javascript">outsystems.internal.$._waitForViewstate = true;outsystems.internal.$(document).ready(function() {outsystems.internal.$('input[name=__OSVSTATE]').val('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx');outsystems.internal.$._waitForViewstate = false;});</script>
If the variable already holds the value why do they have to overwrite it through the ready function?
During a screen development and during publish, i got an error saying more than 64000 variables are not allowed/ exceed 64k variables. We are using java implementation. Is this because of view state or different?
Sridhar Sivaprakasam wrote:
It's because of viewstate. Java has a limit.
Please reach out to me internally, since we work for the same company and it's my job to help folks with these kinds of issues, and I'll help you solve this problem. usually when you see this limitation, it is due to a poor UI design or a mistake in the screen's architecture. And the workarounds to allow big viewstates end up causing performance problems.
J.Ja
Justin James wrote:
I really would like to see a screen resulting in more as 64k vars :-D , must be some kind of editable grid implementation?
Hi Justin,
Its our Application Review screen, where we display complete information about a customer's application, bureau, applicant, fraud, co-applicant information. We have 10 web blocks in it as a different sections.. :)
Unfortunately, we have such kind of screen. Out OOB implementation + customer requirement exceeds the limit. I used a popup editor to fix this..
Thank you,
Sridhar. S
We were having some issues with view state too, a couple of helpful things we found in troubleshooting:
I think that at the start it is empty, when doc build is ready then the code assigns a value to it, when you look it is filled because you look at the finished document. (hmmm .. not sure if this is completely explanatory enough of the process;-)) Probably this javascript code is generated dynamically when the page is processed by OutSystems
I'm using "View page source" and not "Inspect element".
"View page source" won't reflect the changes made dynamically through jquery.
Wim -
I see this all the time. Queries that return a lot of fields, then put them into a ListRecords or TableRecords with widgets bound to those fields will do it.
The problem is almost always caused by poor UI design! If you look that the screens which have the issue, you will see that they are showing far too much data to be useful or usable anyways.
Hello João,
How do we define a large viewstate and a small viewstate in terms of size?
Edgar
Viewstate is a feature of Web Forms.
Now that Microsoft is switching to .NET Core, they're doing away with web forms and switching to MVC.
In the future, will Viewstate be deprecated in Outsystems code, or will you guys find a way to create a proprietary kind of viewstate?