function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dipudipu 

Custom components increases the internal view state size

The size of the internal view state increases dramatically when custom components are used. Only the internal view state size increases. Other view state sizes are small. Are there any ways to take care of this issue? I want to display children and grand children records using custom components.

 

 

<apex:dataTable value="{!mainRecord.childRecords}"
                var="childRecord" 
		width="100%">
    <apex:column >
        <c:ChildRecordView id="idChild1" 
	               dataRecord="{!childRecord}"
			/> 
    </apex:column>
</apex:dataTable>	

The size increases even when the mainRecord.childRecords is empty.

Ankit AroraAnkit Arora

Don't sure this will fit in your req or not still worth a look.

 

http://forceguru.blogspot.com/2010/11/best-practise-to-write-apex.html

 

 

Thanks
Ankit Arora

 

dipudipu

That does not help. I made all controller properties transient to reduce the view state size of controller components to 4 kb. The internal view state size does not go down unless I remove the custom components. Strange thing is even if the components are actually not used, it affects the view state size. The internal view state size depends on how many times the components are present in the visual force page.

Ankit AroraAnkit Arora

It depends upon the view state occupied by your component... You can check this by Setup > My Personal Information > Personal Information > Enable Development Mode "On" and then > Show view state in development mode "On"...

 

 

Thanks
Ankit Arora

 

dipudipu

view state

 

See my view state attached. This is before I made my controller properties transient. I broguht controller size down to 4kb and the internal size remained unchanged.

TehNrdTehNrd

Did you evern make any progress on this. I to am see very large internal view state when using many custom components.