I am managing a visualforce page, which on loading run all the queries twice, both queries made from the controller of the page or from the custom components. I don't understand how this can happen. We found this because we had a reached limit of the SOQL, after that we made some optimizations, but we don't understand why all queries are executed twice. The page use a lot of custom components, and I don't know if they can interfere with the page in some way... anyone had a similar experience or know what happen?
thnks in advance... Klodjan
The page is the following...
<apex:page tabStyle="Dossier_Cliente__tab" title="Dossier Cliente" StandardController="Account" extensions="CruscottoCliente">
<c:KillerStyle />
<apex:message />
<apex:enhancedList height="400" rowsPerPage="10" listId="{!ListViewId}" customizable="true" rendered="{! !(bId)}"/>
<apex:detail relatedList="false" subject="{!Account.Id}" title="true" rendered="{!bId}" inlineEdit="true"/>
<apex:outputPanel rendered="{!(bId)}">
<apex:form >
<apex:commandButton value="{!$Label.SendDunningLetter}" action="{!Sollecito}"/>
<apex:inputHidden value="{!Account.Invio_Sollecito__c}"/>
<Br/>
<Br/>
</apex:form>
</apex:outputPanel>
<apex:outputpanel rendered="{!(bId)}">
<div id="crabbtabs">
<ul>
<li style="display:{!IF( Account.Mondo_Scuola__c , 'None', '')}">
<a href="#tabs-1">{!$Label.ExpiredAmountsAgeing}</a>
</li>
<li><a href="#tabs-2">{!$Label.Cases}</a></li>
<li><a href="#tabs-3">{!$Label.Services}</a></li>
<li><a href="#tabs-11">Fruitori</a></li>
<li><a href="#tabs-4">{!$Label.Addresses}</a></li>
<li><a href="#tabs-5">{!$Label.StatementOfAccount}</a></li>
<li><a href="#tabs-6">{!$Label.RepaymentPlans}</a></li>
<li style="display:{!IF( Account.Mondo_Scuola__c , 'None', '')}">
<a href="#tabs-7">{!$Label.BalanceVariations}</a>
</li>
<li><a href="#tabs-8">{!$Label.Activities}</a></li>
<li><a href="#tabs-9">{!$Label.Documentation}</a></li>
<li><a href="#tabs-10">Chatter</a></li>
</ul>
<div id="tabs-1" >
<div style="display:{!IF( Account.Mondo_Scuola__c , 'None', '')}">
<apex:pageblock title="{!$Label.ExpiredAmountsAgeing}" id="StackedChart">
<apex:pageBlockSection >
<c:StckdChart8Val StkData="{!StkData}" MinRes="0" MaxRes="{!MaxRes}" TopSteps="5" BottomSteps="10"/>
</apex:pageBlockSection>
<apex:pageblockSection >
<c:Chart2Val ChartData="{!pieData}" MinRes="0" MaxRes="100" Steps="5" TitoloGenerale="Ageing" TitoloAsse1="# Movimenti" TitoloAsse2="Scaduto €"/>
</apex:pageblockSection>
</apex:pageblock>
<c:RiepilogoScaduto ChartData="{!pieData}"/>
</div>
</div>
<div id="tabs-2">
<c:TblPage sObj="CredMan__Pratica__c" IdParent="{!Account.Id}" sParent="Cliente"/>
</div>
<div id="tabs-3">
<c:TblPage sObj="CredMan__Servizio__c" IdParent="{!Account.Id}" sParent="Cliente"/>
</div>
<div id="tabs-4">
<c:TblPage sObj="CredMan__Indirizzi__c" IdParent="{!Account.Id}" sParent="Cliente"/>
</div>
<div id="tabs-5">
<c:TblPage sObj="CredMan__Movimento__c" IdParent="{!Account.Id}" sParent="Cliente"/>
</div>
<div id="tabs-6">
<c:TblPage sObj="CredMan__Piano_di_Rientro__c" IdParent="{!Account.Id}" sParent="Cliente"/>
</div>
<div id="tabs-7" style="display:{!IF( Account.Mondo_Scuola__c , 'None', '')}">
<c:TblPage sObj="CredMan__Storico_Movimentazione_Pratiche__c" IdParent="{!Account.Id}" sParent="Cliente" NomeParent="{!Account.Name}"/>
</div>
<div id="tabs-8">
<c:TblAttUltimoAnno TipoAtt="{!TipoAtt}" LastYear="{!LastYear}" mMesiAtt="{!mMesiAtt}"/>
<c:TblPage sObj="Task" IdParent="{!Account.Id}" sParent="Cliente"/>
</div>
<div id="tabs-9">
<c:TblPage sObj="Attachment" IdParent="{!Account.Id}" sParent="Cliente"/>
<apex:pageBlock title="{!$Label.UploadNewDocuments}">
<c:FileUpload parentId="{!Account.Id}"/>
</apex:pageBlock>
</div>
<div id="tabs-10">
<chatter:feedWithFollowers entityId="{!Account.Id}" showHeader="false"/>
</div>
<div id="tabs-11">
<c:TblPage sObj="Servizi_Item__c" IdParent="{!Account.Id}" sParent="Cliente"/>
</div>
</div>
</apex:outputpanel>
</apex:page>
Attribution to: Klodj_Meta
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/33851