title: VisualForce page does not display a list of records or any records BUT it can display the list size
body: <p><strong>VisualForce</strong> page not displaying a list of records - title says it all.</p>
  
  <p>How do I get the <strong>VF</strong> page to display the records that it is obviously counting (as it says <strong>1-15</strong> of <strong>7549</strong> records).</p>
  
  <p>Looks like this:</p>
  
  <p><a href="http://i.imgur.com/KuChyJn.png" rel="nofollow">http://i.imgur.com/KuChyJn.png</a> - '<em>Wells</em>' page</p>
  
  <p>However, this is what we want it to look like (the one that we currently have working!):</p>
  
  <p><a href="http://i.imgur.com/uwXOsHS.png" rel="nofollow">http://i.imgur.com/uwXOsHS.png</a> - '<em>Modems</em>' page (I blacked out some fields, as the company we work for may not want this information disclosed)</p>
  
  <p>My team is working on a salesforce.com application and we have an object, '<em>Modem</em>', that contains approximately <strong>7,500</strong> records.</p>
  
  <h1><strong>ModemController</strong></h1>
  
  <p>We have created a custom controller, <strong>ModemController</strong>: </p>
  
  <pre><code>public class ModemController {
  
  public apexpages.standardsetcontroller con {get;set;}
  public Integer noOfRecords{get; set;}
  public Integer size{get; set;}
  public Modem__c modems {get; set;}
  
  public List&lt;Modem__c&gt; AllSearchModems
  {
      get
      {
          if (con!= null)
              return (List&lt;Modem__c&gt;)con.getRecords();
          else
              return null;
      }
      set;
  }
  
  public ModemController() {
      AllSearchModems = new List&lt;Modem__c&gt;();
      modems = new Modem__c();
  
      String Name = ApexPages.currentPage().getParameters().get('Name');
      List&lt;Modem__c&gt; modems = [SELECT Name FROM Modem__c WHERE ID= :Name];
  }
  
  public PageReference save()
  {
      update modems;
      return new PageReference('/' + modems.Name);
  }
  
  
  public ApexPages.StandardSetController setCon {
      get{
          if(setCon == null){
              size = 15;
              string queryString = 'SELECT Name, ModemActive__c, ModemCarrier__c, ModemCarrierData__c, DataPlanName__c, ESNNumber__c, ModemICCID__c, IMEINumber__c, IMSINumber__c, ModemIPEXT__c, ModemJob__c, ModemManufacturer__c, ModemModel__c, ModemPhone__c, PortForwarding__c, ModemIPPort__c, SIMNumber__c, ModemIPSlave__c, ModemStaticIP__c, ModemFirmwareVersion__c FROM Modem__c ORDER BY Name';
              setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
              setCon.setPageSize(size);
              noOfRecords = setCon.getResultSize();
          }
          return setCon;
      }
      set;
  }
  
  public List&lt;Modem__c&gt; getModems()
  {
      List&lt;Modem__c&gt; modemList = new List&lt;Modem__c&gt;();
      for(Modem__c w : (List&lt;Modem__c&gt;)setCon.getRecords())
         modemList.add(w);
      return modemList;
  }
  
  public PageReference refresh() {
      setCon = null;
      getModems();
      setCon.setPageNumber(1);
      return null;
  }
  
  
  
  public PageReference Search()
  {
      if (modems.Name != null)
      {
          con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Name, ModemActive__c,ModemCarrier__c,ModemCarrierData__c,DataPlanName__c,ESNNumber__c,ModemICCID__c, IMEINumber__c,IMSINumber__c,ModemIPEXT__c,ModemJob__c, ModemManufacturer__c,ModemModel__c,ModemPhone__c, PortForwarding__c, ModemIPPort__c,SIMNumber__c,ModemIPSlave__c,ModemStaticIP__c, ModemFirmwareVersion__c FROM Modem__c  Modem__c WHERE Name= :modems.Name]));  
          con.setPageSize(10);
      }
      else
      {
          con = null;
      }
      return null;
  }
  
  public Boolean hasNext {
      get {
          return setCon.getHasNext();
      }
      set;
  }
  public Boolean hasPrevious {
      get {
          return setCon.getHasPrevious();
      }
      set;
  }
  
  public Integer pageNumber {
      get {
          return setCon.getPageNumber();
      }
      set;
  }
  
  public void first() {
      setCon.first();
  }
  
  public void last() {
      setCon.last();
  }
  
  public void previous() {
      setCon.previous();
  }
  
  public void next() {
      setCon.next();
  }
  }
  </code></pre>
  
  <h1>Custom <strong>VF</strong> page for '<em>Wells</em>' page</h1>
  
  <p>Here is the custom <strong>visualforce</strong> page for the '<em>Wells</em>' page:</p>
  
  <pre><code>&lt;apex:page controller="ModemController"&gt;
  &lt;apex:form &gt;
      &lt;apex:pageBlock id="pb"&gt;          
          &lt;apex:pageBlockTable value="{!Modems}" var="m"&gt;    
              &lt;apex:column value="{!m.Name}" /&gt;   
              &lt;apex:column value="{!m.ModemManufacturer__c}"/&gt;
              &lt;apex:column value="{!m.ModemModel__c}"/&gt; 
              &lt;apex:column value="{!m.ModemICCID__c}"/&gt; 
              &lt;apex:column value="{!m.ModemIPEXT__c}"/&gt;
              &lt;apex:column value="{!m.ModemCarrier__c}"/&gt;
              &lt;apex:column value="{!m.ModemActive__c}"/&gt;
          &lt;/apex:pageBlockTable&gt;
           &lt;apex:panelGrid columns="7"&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="|&lt;" action="{!first}" disabled="{!!hasPrevious}" title="First Page"/&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="&lt;" action="{!previous}" disabled="{!!hasPrevious}" title="Previous Page"/&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="&gt;" action="{!next}" disabled="{!!hasNext}" title="Next Page"/&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="&gt;|" action="{!last}" disabled="{!!hasNext}" title="Last Page"/&gt;
              &lt;apex:outputText &gt;{!(pageNumber * size)+1-size}-{!IF((pageNumber * size)&gt;noOfRecords, noOfRecords,(pageNumber * size))} of {!noOfRecords}&lt;/apex:outputText&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="Refresh" action="{!refresh}" title="Refresh Page"/&gt;
              &lt;apex:outputPanel style="color:#4AA02C;font-weight:bold"&gt;
              &lt;apex:actionStatus id="fetchStatus" startText="Fetching..." stopText=""/&gt;
              &lt;/apex:outputPanel&gt;
          &lt;/apex:panelGrid&gt;           
  
      &lt;/apex:pageBlock&gt;
  &lt;/apex:form&gt;
  </code></pre>
  
  <p></p>
  
  <p>This <strong>controller</strong> works for other tabs, (see the '<em>Wells</em>' page, it uses an identical controller and it works!) but does not work for '<em>Modems</em>' page.</p>
  
  <p>We see that '<em>Modems</em>' page is at least reading in the <strong>7,549</strong> records (by looking at a variable noOfRecords to count how many there are) but not displaying them.  I have even tried adding <strong>LIMIT</strong> to the <strong>SOQL</strong> query, to no avail.  (limited it to 2,000, 1999, 1001, 1000, 999, and even 30,20, and 10)</p>
  
  <p>I don't think the amount of records is the issue, I could be wrong.</p>
  
  <p>If anyone has any tips, it would be greatly appreciated!</p>
  
  <h1>WellController</h1>
  
  <p>If anyone requests, here is the working code for the '<em>Wells</em>' page, both <strong>VisualForce</strong> and <strong>Apex</strong> code:
  <em>WellController</em>:
      public class WellController {</p>
  
  <pre><code>public apexpages.standardsetcontroller con {get;set;}
  public Integer noOfRecords{get; set;}
  public Integer size{get; set;}
  public Well__c wellz {get; set;}
  
  public List&lt;Well__c&gt; AllSearchWells
  {
      get
      {
          if (con!= null)
              return (List&lt;Well__c&gt;)con.getRecords();
          else
              return null;
      }
      set;
  }
  
  
  public WellController() {
      AllSearchWells = new List&lt;Well__c&gt;();
      wellz = new Well__c();
  
      String Name = ApexPages.currentPage().getParameters().get('Name');
      List&lt;Well__c&gt; wellz = [SELECT Name FROM Well__c WHERE ID = :Name];
  }
  
  public PageReference save()
  {
      update wellz;
      return new PageReference('/' + wellz.Name);
  }
  
  
  public ApexPages.StandardSetController setCon {
      get{
          if(setCon == null){
              size = 15;
              string queryString = 'SELECT Name, WellLocActivationDate__c, Active__c, AntennaType__c, WellLocBillTo__c, CompanyName__c, CompanyName_del__c, WellLocCompanyName__c, ConnectedCarrier__c, ContactReponsible__c, DataNetwork__c, WellLocSPOCDataPlan__c, WellSiteEquipHistory__c, WellLoclPD__c, WellLocKillDate__c, ModemConnectedTo__c, Name__c, WellLocModemSerial__c, SignalQuality__c, SignalStrength__c, SimCardNumber__c, TechResponsible__c, Action__c, ActionDate__c, WellLocName__c, WellLocOwningCompanyName__c FROM Well__c ORDER BY Name';
              setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
              setCon.setPageSize(size);
              noOfRecords = setCon.getResultSize();
          }
          return setCon;
      }
      set;
  }
  
  public List&lt;Well__c&gt; getWells()
  {
      List&lt;Well__c&gt; wellList = new List&lt;Well__c&gt;();
      for(Well__c w : (List&lt;Well__c&gt;)setCon.getRecords())
          wellList.add(w);
      return wellList;
  }
  
  public PageReference refresh() {
      setCon = null;
      getWells();
      setCon.setPageNumber(1);
      return null;
  }
  
  
  
  public PageReference Search()
  {
      if (wellz.Name != null)
      {
          con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Name, WellLocActivationDate__c, Active__c, AntennaType__c, WellLocBillTo__c, CompanyName__c, CompanyName_del__c, WellLocCompanyName__c, ConnectedCarrier__c, ContactReponsible__c, DataNetwork__c, WellLocSPOCDataPlan__c, WellSiteEquipHistory__c, WellLoclPD__c, WellLocKillDate__c, ModemConnectedTo__c, Name__c, WellLocModemSerial__c, SignalQuality__c, SignalStrength__c, SimCardNumber__c, TechResponsible__c, Action__c, ActionDate__c, WellLocName__c, WellLocOwningCompanyName__c FROM Well__c  Well__c where Name = :wellz.Name]));  
          con.setPageSize(10);
      }
      else
      {
          con = null;
      }
      return null;
  }
  
  public Boolean hasNext {
      get {
          return setCon.getHasNext();
      }
      set;
  }
  public Boolean hasPrevious {
      get {
          return setCon.getHasPrevious();
      }
      set;
  }
  
  public Integer pageNumber {
      get {
          return setCon.getPageNumber();
      }
      set;
  }
  
  public PageReference make() 
  {
  
    return Page.wellCreate;
  }
  
  
  
  public void first() {
      setCon.first();
  }
  
  public void last() {
      setCon.last();
  }
  
  public void previous() {
      setCon.previous();
  }
  
  public void next() {
      setCon.next();
  }
  }
  </code></pre>
  
  <h1><strong>VF</strong> page - '<em>Wells</em>'</h1>
  
  <p>And the <strong>VisualForce</strong> page associated with the '<em>Wells</em>' object:</p>
  
  <pre><code>&lt;apex:page controller="WellController"&gt;
  &lt;apex:form &gt;
      &lt;apex:pageBlock title="Wells" id="pb"&gt;
          &lt;apex:pageBlockSection &gt;
  
          &lt;apex:commandButton action="{!make}" value="Create New"/&gt;
  
      &lt;/apex:pageBlockSection&gt;
          &lt;apex:pageBlockTable value="{!Wells}" var="w"&gt;
              &lt;apex:column headerValue="Well Name"&gt;
                  &lt;apex:outputLink value="/apex/wellEdit?id={!w.id}"&gt;{!w.WellLocName__c}&lt;/apex:outputLink&gt;
              &lt;/apex:column&gt;
              &lt;apex:column value="{!w.WellLocModemSerial__c}" /&gt;
              &lt;apex:column value="{!w.WellLocCompanyName__c}" /&gt;
              &lt;apex:column value="{!w.WellLocOwningCompanyName__c}" /&gt;
              &lt;apex:column value="{!w.WellLocBillTo__c}" /&gt;
              &lt;apex:column value="{!w.Active__c}" /&gt;
          &lt;/apex:pageBlockTable&gt;
          &lt;apex:panelGrid columns="7"&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="|&lt;" action="{!first}" disabled="{!!hasPrevious}" title="First Page"/&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="&lt;" action="{!previous}" disabled="{!!hasPrevious}" title="Previous Page"/&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="&gt;" action="{!next}" disabled="{!!hasNext}" title="Next Page"/&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="&gt;|" action="{!last}" disabled="{!!hasNext}" title="Last Page"/&gt;
              &lt;apex:outputText &gt;{!(pageNumber * size)+1-size}-{!IF((pageNumber * size)&gt;noOfRecords, noOfRecords,(pageNumber * size))} of {!noOfRecords}&lt;/apex:outputText&gt;
              &lt;apex:commandButton status="fetchStatus" reRender="pb" value="Refresh" action="{!refresh}" title="Refresh Page"/&gt;
              &lt;apex:outputPanel style="color:#4AA02C;font-weight:bold"&gt;
              &lt;apex:actionStatus id="fetchStatus" startText="Fetching..." stopText=""/&gt;
              &lt;/apex:outputPanel&gt;
          &lt;/apex:panelGrid&gt;
      &lt;/apex:pageBlock&gt;
  &lt;/apex:form&gt;
  </code></pre>
  
  <p></p>