+ Start a Discussion
ThomasmThomasm 

filtered Related lists

I currently have a visualforce page that is used to display the Job information (same as an account).  I am using tabs to break up the data and an extension to help me sort the data.  Currenlty i have 3 tabs one detail tab and the other 2 are set to show the exact same thing.  the problem i am having is only one tab pulls the data and the other says it keeps trying to load.  

Here is the page

<apex:page standardController="Jobs__c" extensions="sclSort4" >
<apex:pageMessages id="msgs"/>
    <apex:tabPanel switchType="client" selectedTab="Detailed View" id="theTabPanel">
        <apex:tab label="Detailed View" name="Detailed View">
        <apex:form >
            <apex:detail title="false" relatedList="false"/>
        </apex:form>
        </apex:tab>       
        
        <apex:tab label="Open Pages" name="Open Service Call Logs2">
        <apex:form >
         <apex:actionFunction name="loadPgsJS" action="{!loadpgs}" rerender="pgsPanel, pgsJS, msgs"/>
        <apex:pageBlock >
        <apex:outputPanel id="pgsPanel">
      <apex:outputPanel rendered="{!pgsNeeded}">    
      
          <div id="spinner">
            <p align="center" style='{font-family:"Arial", Helvetica, sans-serif; font-size:20px;}'><apex:image value="/img/loading.gif"/></p>
          </div>       
      </apex:outputPanel>
      <apex:outputPanel rendered="{!NOT(pgsNeeded)}">
        <apex:pageBlockSection title="Open Service Call Logs" columns="1">        
          <apex:pageBlockTable value="{!pgs}" var="pg" rendered="{!pgsFound}">
            <apex:column headerValue="{!$ObjectType.Opportunity.fields.Name.label}">
              <apex:outputLink value="/{!pg.id}">{!pg.Name}</apex:outputLink>
            </apex:column>
    
          </apex:pageBlockTable>
          <apex:outputText value="No opportunities found" rendered="{!NOT(pgsFound)}"/>
        </apex:pageBlockSection>
      </apex:outputPanel>
    </apex:outputPanel>
        </apex:pageBlock>          
        
        <apex:outputPanel id="pgsJS">
    <apex:outputPanel rendered="{!pgsNeeded}">
   <script>
     loadPgsJS();
   </script>
   </apex:outputPanel>
 </apex:outputPanel>      
   </apex:form>        
         </apex:tab>         
        <apex:tab label="Open Pages" name="Open Service Call Logs23">
        <apex:form >
         <apex:actionFunction name="loadPgsJS" action="{!loadpgs}" rerender="pgsPanel, pgsJS, msgs"/>
       <apex:pageBlock >
        <apex:outputPanel id="pgsPanel">
      <apex:outputPanel rendered="{!pgsNeeded}">     
          <div id="spinner">
            <p align="center" style='{font-family:"Arial", Helvetica, sans-serif; font-size:20px;}'><apex:image value="/img/loading.gif"/></p>
          </div>       
      </apex:outputPanel>
      <apex:outputPanel rendered="{!NOT(pgsNeeded)}">
        <apex:pageBlockSection title="Open Service Call Logs" columns="1">
        <apex:pageBlockTable value="{!pgs}" var="pg" rendered="{!pgsFound}">
            <apex:column headerValue="{!$ObjectType.Opportunity.fields.Name.label}">
              <apex:outputLink value="/{!pg.id}">{!pg.Name}</apex:outputLink>
            </apex:column>          
         </apex:pageBlockTable>
          <apex:outputText value="No opportunities found" rendered="{!NOT(pgsFound)}"/>
        </apex:pageBlockSection>
      </apex:outputPanel>
    </apex:outputPanel>
        </apex:pageBlock>
        <apex:outputPanel id="pgsJS">
    <apex:outputPanel rendered="{!pgsNeeded}">
   <script>
     loadPgsJS();
   </script>
   </apex:outputPanel>
 </apex:outputPanel>
   </apex:form>
         </apex:tab>
    </apex:tabPanel>
</apex:page>



and here is the extension

public with sharing class sclSort4 {
    private ApexPages.StandardController stdCtrl;
        
    public List<service_Call_log__C> pgs {get; set;}
    
    public Boolean pgsNeeded {get; set;}
    
    public Boolean pgsFound {get; set;}
    
   
    public sclSort4(ApexPages.StandardController std)
    {
        stdCtrl=std;
        pgsNeeded=true;
        pgsFound=false;
    }
    
 
    public PageReference loadpgs()
    {
        pgs=[select id, Name from service_call_log__C where Job__C=:stdCtrl.getId() ];
        pgsNeeded=false;
        pgsFound=(pgs.size()>0);
        
        return null;
    }
}