Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Apex Code Development
- :
- Problem with COPIED-EDITED-PASTED code from tutori...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Problem with COPIED-EDI TED-PASTED code from tutorial.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-15-2012 10:35 AM
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.
Solved! Go to Solution.
Re: Problem with COPIED-EDI TED-PASTED code from tutorial.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-15-2012 10:42 AM
Fixed:
<apex:column headerValue="Item name" style="text-align:left">
<apex:outputText value="{!pitem.merchandise.name}"/>
</apex:column>
<apex:column headerValue="Price" >
<apex:outputText value="{!pitem.merchandise.Item_Price__c}"/>
</apex:column>
Assuming all fields are otherwise correct.
~ sfdcfox ~
I am a sandwich. That is all.
Re: Problem with COPIED-EDI TED-PASTED code from tutorial.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-15-2012 10:55 AM
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!
Re: Problem with COPIED-EDI TED-PASTED code from tutorial.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-15-2012 10:59 AM
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.
~ sfdcfox ~
I am a sandwich. That is all.
Re: Problem with COPIED-EDI TED-PASTED code from tutorial.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-15-2012 11:09 AM
Thank you again :)

