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
BRomanowskiBRomanowski 

VisualForce Page not displaying results

I'm trying to put together a quick page for our reps to indicate who should be receiving holdiday cards but when the page comes up all the rows are blank. It's weird because depending on the view filter the table size changes like there is something there but it doesn't display anything. Here is my code.

 

<apex:page standardController="Contact" recordSetVar="Contacts"
tabStyle="Contact"
sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
<apex:panelGrid columns="2">
<apex:outputLabel value="View:"/>
<apex:selectList value="{!filterId}" size="1">
<apex:actionSupport event="onchange" rerender="cons"/>
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
</apex:panelGrid>
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:panelGrid columns="2">
<apex:commandLink action="{!previous}">Previous</apex:commandlink>
<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>
<apex:pageBlockTable value="{!Contacts}" var="con" id="cons" rows="50" >
<apex:column value="{!contact.Account}"/>
<apex:column headerValue="Name" >
<apex:outputLink value="https://vfa.my.salesforce.com/{!con}" target="_blank">{!contact.name}
</apex:outputLink>
</apex:column>
<apex:column headerValue="Send Holiday Card">
<apex:inputField value="{!contact.Send_Holiday_Card__c}"/>
</apex:column>
</apex:pageBlockTable>
<apex:panelGrid columns="2">
<apex:commandLink action="{!previous}">Previous</apex:commandlink>
<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>
</apex:pageBlock>
</apex:form>
</apex:page>

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

Try this code :

 

<apex:page standardController="Contact" recordSetVar="Contacts"
tabStyle="Contact"
sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
<apex:panelGrid columns="2">
<apex:outputLabel value="View:"/>
<apex:selectList value="{!filterId}" size="1">
<apex:actionSupport event="onchange" rerender="cons"/>
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
</apex:panelGrid>
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:panelGrid columns="2">
<apex:commandLink action="{!previous}">Previous</apex:commandlink>
<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>
<apex:pageBlockTable value="{!Contacts}" var="con" id="cons" rows="50" >
<apex:column value="{!con.Account.Name}"/>
<apex:column headerValue="Name" >
<apex:outputLink value="https://vfa.my.salesforce.com/{!con}" target="_blank">{!con.name}
</apex:outputLink>
</apex:column>
<apex:column headerValue="Send Holiday Card">
<apex:inputField value="{!con.Send_Holiday_Card__c}"/>
</apex:column>
</apex:pageBlockTable>
<apex:panelGrid columns="2">
<apex:commandLink action="{!previous}">Previous</apex:commandlink>
<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Let me know if it still don't work for you.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Chamil MadusankaChamil Madusanka
<apex:page standardController="Contact" recordSetVar="Contacts"
tabStyle="Contact"
sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
<apex:panelGrid columns="2">
<apex:outputLabel value="View:"/>
<apex:selectList value="{!filterId}" size="1">
<apex:actionSupport event="onchange" rerender="cons"/>
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
</apex:panelGrid>
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:panelGrid columns="2">
<apex:commandLink action="{!previous}">Previous</apex:commandlink>
<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>
<apex:pageBlockTable value="{!Contacts}" var="con" id="cons" rows="50" >
<apex:column value="{!contact.Account}"/>
<apex:column headerValue="Name" >
<apex:outputLink value="/{!con}" target="_blank">{!contact.name}
</apex:outputLink>
</apex:column>
<apex:column headerValue="Send Holiday Card">
<apex:inputField value="{!contact.Send_Holiday_Card__c}"/>
</apex:column>
</apex:pageBlockTable>
<apex:panelGrid columns="2">
<apex:commandLink action="{!previous}">Previous</apex:commandlink>
<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>
</apex:pageBlock>
</apex:form>
</apex:page>

Try Above code

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

BRomanowskiBRomanowski

Still nothings. It's really weird.

 

Ankit AroraAnkit Arora

Try this code :

 

<apex:page standardController="Contact" recordSetVar="Contacts"
tabStyle="Contact"
sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
<apex:panelGrid columns="2">
<apex:outputLabel value="View:"/>
<apex:selectList value="{!filterId}" size="1">
<apex:actionSupport event="onchange" rerender="cons"/>
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
</apex:panelGrid>
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:panelGrid columns="2">
<apex:commandLink action="{!previous}">Previous</apex:commandlink>
<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>
<apex:pageBlockTable value="{!Contacts}" var="con" id="cons" rows="50" >
<apex:column value="{!con.Account.Name}"/>
<apex:column headerValue="Name" >
<apex:outputLink value="https://vfa.my.salesforce.com/{!con}" target="_blank">{!con.name}
</apex:outputLink>
</apex:column>
<apex:column headerValue="Send Holiday Card">
<apex:inputField value="{!con.Send_Holiday_Card__c}"/>
</apex:column>
</apex:pageBlockTable>
<apex:panelGrid columns="2">
<apex:commandLink action="{!previous}">Previous</apex:commandlink>
<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Let me know if it still don't work for you.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
BRomanowskiBRomanowski

That did it! Thank you soo much

James KosharskyJames Kosharsky
Thanks for saying what you changed.  This help group is ridiculous.