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
aneelu vaddadianeelu vaddadi 

I created an apex class and VF page in Eclipse, there are no errors when I want to display VF page I am unable to see th result..can any one help me

apex:page controller="StoreFrontController_AC" tabstyle="Merchandise__c" >
<apex:pageBlock title="our products">
        <apex:pageBlockSection columns="1">
            <apex:pageBlockTable value="{!products}" var="pitem">
                <apex:column headerValue="Product">
                    <apex:outputText value="{!pitem.Name}"/>
                </apex:column>
                <apex:column headerValue="Description">
                    <apex:outputText value="{!Description__c}"/>
                </apex:column>
                <apex:column headerValue="Price" style="text-align: right;">
                    <apex:outputText value="{0,number,currency}">
                    <apex:param value="{!pitem.Price}"/>
                    </apex:outputText>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

APEX CLASS:

public with sharing class StoreFrontController_AC {
    list<DisplayMerchandise> products;
    
    public list<DisplayMerchandise> getProducts(){
        if(products == Null){
            products = new List<DisplayMerchandise>();
            for(Merchandise__c item : [
                SELECT Id,Name,Description__c,Price__c FROM Merchandise__c]){
                     products.add(new DisplayMerchandise(item));    
                }    
        }
        return products;
    }
    // Inner class to hold online store details for item
    public class DisplayMerchandise {
        private Merchandise__c merchandise;
         public DisplayMerchandise(Merchandise__c item) {
             this.merchandise = item;
         }
         public String name {
             get { return merchandise.Name; }
         }
          public String description {
              get { return merchandise.Description__c; }
          }
          public Decimal price {
              get { return merchandise.Price__c; }
          }
          public Boolean inStock {
          get { return (0 < merchandise.Total_Inventory__c); }
          }
          public Integer qtyToBuy { get; set; }
         
    }
    

}

for viewing the result,https://c.na31.visual.force.com/apex/Catalog_VF
Please help 
Abhishek BansalAbhishek Bansal
Hi,

There is a simple thing which you are missing here.
Please add public in front of products list.

Please change your 2nd line :
FROM : list<DisplayMerchandise> products;
TO: public list<DisplayMerchandise> products;

Let me know if you still have any issue

Thanks,
Abhishek
aneelu vaddadianeelu vaddadi
Thank you Abhishek, Still i am not able to display, when I click this https://c.na31.visual.force.com/apex/Catalog_VF it is simply showing Congratulations This is your new Page
 
Abhishek BansalAbhishek Bansal
That means your VF page is not saved correctly.
Please save it correctly and verify it by opening on Browser that it contains the same code that u have written on eclipse or not.
Please save ur VF page and class directlt on browser as there may be some problem in SYNC with Eclipse.

Thanks,
Abhishek
aneelu vaddadianeelu vaddadi
I got it now , Abhishek , In this line    <apex:outputText value="{!Description__c}"/>  i should give its variable name instead of API name 
anyways Thank u