I have a pageblock table that uses a custom controller to access a custom object through the SOQL. The page, when I click preview, does not load anything from the custom objects. (I've set the SOQL) to retrieve all of the custom objects. I am unable to figure out why there is nothing being loaded on the page. Attached is the code below for the VF page and the APEX controller.
<apex:page standardStylesheets="false" sidebar="false"
Controller="ProductByVan">
...
<h1>Cart Details</h1>
<apex:pageBlock >
<apex:pageBlockTable value="{!outSku}" var="VAN" style="table">
<apex:column >
<apex:facet name="header">VAN Type</apex:facet>
<apex:outputText value="{!VAN.VANType__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Item Code</apex:facet>
<apex:outputText value="{!VAN.Item_Code__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Item Description</apex:facet>
<apex:outputText value="{!VAN.ItemDescription__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2}
</style>
Below is the APEX Controller
public class ProductByVan{
// The action function parameter gets set here - this is the input
//public String skey {get; set;}
// The output is set here so it can be re-rendered into the page
public List<VAN__c> outSku {get; set;}
public PageReference retrieve() {
// TODO why is this only returning on and anarbitrary one at that?
// Pass in the skey via a bind variable
List<VAN__c> skus = [
select Item_Code__c, VANType__c, ItemDescription__c
from VAN__c
];
// Pass out the value
outSku = skus;
return null;
}
}