You need to sign in to do that
Don't have an account?

what is view state and need a steps how can we reduce view state without help of transient
view state and need a steps how can we reduce view state without help of transient
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
For exmaple, when you create a VF page having a some input fields, no consider that you load this page with some value and there are some required field on this page and when you click on a button this page will get submited to server then when server replay back your page should be loaded in same state as it was before submit button click, to mantain this salesforce exchange data between VF and saevers and this information which salesforce mantian is know as View state,
In simple words , it is a state ot view which you are view and salesforce use it to regenerate your page, when ever there reply come back from server
other then transient, you can user VF remoting and @ remote action, as it wont transfer View state
Also you can user mode=readonly, it a property of <page> tag
The data in the view state should be sufficient to recreate the state of the page when the postback is received. To do this, it stores the following data:
Developer environments have a view state inspector, which lets you view the contents of the view state. This information can help you in optimizing the view state size. Once enabled, it shows up as a tab in Development Mode, as follows. you can enable that from
Edit User-> Select view state checkbox after development mode checkbox.
Check your view state as shown above
Here are some quick tips which will help you to reduce view state size without using transient keyword
Thanks,
Himanshu
View state holds the state of Visual force page.
The view state of a web page is composed of all the data that's necessary to maintain the state of the controller during server requests (like sending or receiving data). Since the view state contributes to the overall size of your page, performance of a page can depend on efficiently managing the view state. The View State tab in the development mode footer provides information about the view state of your Visualforce page as it interacts with Salesforce.
If your not using input tags in visual force page form is not required.Without form Viewstate is not created.
How to reduce View state:
Minimize number of form on a page. Use apex:actionRegion instead of using 2 or more forms.
Refine your SOQL to only retrieve the data needed by the page.
All public and private data members present in Standard, Custom and Controller extensions are saved.
The transient variables are not passed to view state and therefore not stored in View State.
Please check below link for more information.I hope that it will help you.
Please check below link for more information.I hope that it will help you.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_best_practices_performance.htm
i think this may be help you to understand view state in simple words.
here in visual force pages view is coming from UI where it says how it should look and state says this is the way it should looklike.
So the view state is nothing but a state of visualforce page or we can say copy of page that contain only those page members which are usfull to generate same page which we have sent out in our request(by clicking on submit or some other button) to server and moreover view state is nothing but a variable in vf's which hold all the component of view state and and salesforce servers only can undestand it and post back the same page with result as it was before clicking on the submit button.
If u find it best to suite for your better understanding please make it a best answer.
Regards
Arjun
here in visual force pages view is coming from UI where it says how it should look and state says this is the way it should looklike.
So the view state is nothing but a state of visualforce page or we can say copy of page that contain only those page members which are usfull to generate same page which we have sent out in our request(by clicking on submit or some other button) to server and moreover view state is nothing but a encrypted form field in vf's which hold all the component of view state in encapsulated form and salesforce servers only can undestand it and post back the same page with result as it was before clicking on the submit button.
there is a data type called transient but instead of that there are some other options we have to reduce the view state in vf pages
1. Minimize number of form on a page. Use apex:actionRegion instead of using 2 or more forms.
2. All public and private data members present in Standard, Custom and Controller extensions are saved.
3. The transient variables are not passed to view state and therefore not stored in View State.
4. Refine your SOQL to only retrieve the data needed by the page.
5. don't use pagemessage attribute in vf pages.
If u find it best to suite for your better understanding please make it a best answer.
Regards
Arjun
Check this out : http://howtodoitinsalesforce.blogspot.in/2016/12/an-introduction-to-visualforce-view.html