You need to sign in to do that
Don't have an account?
Tyler Harris
Unknown Property Error on Visualforce Page
I'm trying to display a simple counter on my visualforce page that counts the number of shopping cart items.
Error: Unknown Property: "StoreFront.shopCart"
Apex:
Error: Unknown Property: "StoreFront.shopCart"
Apex:
public class StoreFrontController{ list<DisplayMerchandise> products; integer shopCart; public list<DisplayMerchandise> getProducts(){ if(products == null){ products = new List<DisplayMerchandise>(); for (Merchandise__c item : [SELECT Id, Name, Description__c, Price__c, Total_Inventory__c FROM Merchandise__c]) { products.add(new DisplayMerchandise(item)); } } return products; } public Integer getshopCart(){ return shopcart; }
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" controller="StoreFront"> <apex:stylesheet value="{!URLFOR($Resource.styles)}"/> <h1>Store Front</h1> <apex:form > <apex:dataTable value="{!products}" var="pitem" rowClasses="odd,even"> <apex:column headerValue="Product"> <apex:outputText value="{!pitem.merchandise.name}" /> </apex:column> <apex:column headervalue="Price"> <apex:outputText value="{!pitem.merchandise.Price__c}" /> </apex:column> <apex:column headerValue="#Items"> <apex:inputText value="{!pitem.count}"/> </apex:column> </apex:dataTable> <br/> <apex:commandButton action="{!shop}" value="buy" reRender="msg" /> </apex:form> <apex:outputPanel id="msg">{!message}</apex:outputPanel> <apex:form> <apex:dataTable value="{!shopCart}" var='sq' rowClasses="odd,even"> <apex:column> <apex:outputField value='{!sq.count}' /> </apex:column> </apex:dataTable> </apex:form> </apex:page>
Add this constructor?
Check you controller name on your page,
Change it to Let us know if it helps you.
I cannot get my "shopCart" object to display on the page without a "Unknown property 'StoreFront.shopCart.count'
Error is in expression '{!shopCart.count}' in component <apex:outputText> in page storefront"
Visualforce
Apex
Hi Tyler Harris..
Do U get any solution regarding it..???
I also need this kind of Fucntionaly .. if u get any solution Then please share it..
Thank you
Regards,
Nansi Kela