You need to sign in to do that
Don't have an account?
Maximum view state size limit (128K) exceeded - Help?
I've run into a problem with one of my visualforce pages where I'm hitting this 128k viewstate size limit--I need some pointers on how to avoid it.
My page is used to display forms back to my users in a PDF. I've built the forms out in HTML tables with <apex: outputfield> components to display the data. My data structure is set up so that the user creates a Master Object, and then can create and number of child objects, which are the forms. Some of the forms have over 200 fields on them, but a requirement is that the user can display ALL forms they have filled out and print them in one page.
To accomplish this, I have an <apex:repeat> component on my page where the repeat variable is ALL the child records to this master object. This allows me to use the standard controller for the master object, then repeat through all the child objects and display their contents. I'm severely limited right now because once I create more than 5 forms, I start getting this viewstate error. I'm not using a custom controller, so I'm not really sure what I can do on my page to decrease this size, or handle it better. Please let me know if you have a solution!
Using apex:form implies that you have some information to submit, and thus it's going to store all of the (non-transient) data in viewstate. Why are you using apex:form if all you are doing is displaying outputField? I don't think it makes sense to use apex:form if you're using renderAs="pdf" as there is no input and nothing to submit.
All Answers
Can you post some sample code that well help you.this error message seems the size of the displayed date limits exceeds for this in yours controller you need keep null values after displaying the date fields.After seeing yours sample code only I can tell you where you are missing.
This is know issue.
Using apex:form implies that you have some information to submit, and thus it's going to store all of the (non-transient) data in viewstate. Why are you using apex:form if all you are doing is displaying outputField? I don't think it makes sense to use apex:form if you're using renderAs="pdf" as there is no input and nothing to submit.
I know it sounds strange , but i've seen this error when my org was > 100% data storage capacity, i had been uploading files all day, and then my page hit this message, i had no ability to create records or upload any attachments.
once i cleared some data space this message went away.
Jill,
Thank you so much! I was using <apex:form> tags because I was displaying some of the fields in an <apex: selectList> component (this is because I copy/pasted the code from a non pdf version of the page). I changed them all to outputField and took off the form tags, and I'm good to go =)
Please also see this article that delves into View state, the new view state inspector in Summer '10 and finally best practices to optimize view state.
http://wiki.developerforce.com/index.php/An_Introduction_to_Visualforce_View_State
neato botvac review (https://cleaningbeasts.com/neato-botvac-connected-review/)