You need to sign in to do that
Don't have an account?
Nervosa
Problem with COPIED-EDITED-PASTED code from tutorial.
Hello!
I did the following - copied and edited APEX class from tutorial so it looks like this:
public class FullFunctionality { DisplayMerchandise[] products; public class DisplayMerchandise { public Item__c merchandise { get; set; } public DisplayMerchandise(Item__c item) { this.merchandise = item; } } public DisplayMerchandise[] getProducts() { if (products == null) { products = new DisplayMerchandise[]{}; for (Item__c item : [SELECT id, name, item_price__c FROM Item__c ]) { products.add(new DisplayMerchandise(item)); } } return products; } }
My VF page uses this classlike this -
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" Controller="FullFunctionality"> <apex:stylesheet value="{!URLFOR($Resource.Styles, 'styles.css')}"/> <apex:dataTable value="{!products}" var="pitem" rowClasses="odd,even" align="center"> <apex:column > <apex:form style="width:50px"> <apex:inputCheckbox /> </apex:form> </apex:column> <apex:column headerValue="Item name" style="text-align:left"> <apex:outputText value="{!pitem.name}"/> </apex:column> <apex:column headerValue="Price" > <apex:outputText value="{!pitem.Item_Price__c}"/> </apex:column> </apex:dataTable> </apex:page>
But I get an error message:"Error: Unknown property 'FullFunctionality.DisplayMerchandise.name'"
Please help me to get rid of it.
Thanx in advance.
Fixed:
Assuming all fields are otherwise correct.
All Answers
Fixed:
Assuming all fields are otherwise correct.
Thank you - it works!
Not to create another thread i also want to ask - how can i display record's creation date? I can't find it amond standard fields!
It is in there, but doesn't appear that way in the normal list.
* Modify the query to include CreatedDate.
* Modify the page to display CreatedDate.
Thank you again :)