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
angusgrantangusgrant 

Error: Unknown property 'VisualforceArrayList.Name'

Hi I have added a apex controller to my vf page in which I am trying to return a list of a related objects that I am then going to display in the vf page in a apex:datatable. I'm able to create the controller extension no problem but when I view the vf page I get this error:

 

Error: Unknown property 'VisualforceArrayList.Name'

Apex Code:

public class event_session {
private SBS_Event__c sbs_event;


public event_session(ApexPages.StandardController controller) {
this.sbs_event =
(sbs_event__c)controller.getRecord();
}

List<event_sessions__c> event_session = new List<event_sessions__c>();

public List<event_sessions__c> EventSession {
get{
event_session = [Select e.Lecture_Event_Period__c, e.Name from Event_Sessions__c e Where e.SBS_Event__c = :sbs_event.id Order by e.CreatedDate];
return event_session;
}
}




}

 

vf code:
 

//vf fragment<apex:page showHeader="false" standardController="SBS_Event__c" extensions="event_session" > <apex:composition template="StdOCEITemplate" > <apex:define name="pagebody"> <apex:pageBlock title="Event Registration Form"> <apex:form > <table width="100%" border="0" cellspacing="4" cellpadding="0"> <tr> <th width="20%" scope="col">&nbsp;</th> <th width="80%" scope="col">&nbsp;</th> </tr> <tr> <th scope="row" style="">Event:</th> <td style="text-align:left;padding-left:10px;"><strong>{!SBS_Event__c.name}</strong></td> </tr>

 

 
Best Answer chosen by Admin (Salesforce Developers) 
angusgrantangusgrant
Ignore this issue. it was me I had created a datatable list variable with the same name that I was passing out of my controller extension Dow! Dow! . This was causing my issue

All Answers

angusgrantangusgrant
Ignore this issue. it was me I had created a datatable list variable with the same name that I was passing out of my controller extension Dow! Dow! . This was causing my issue
This was selected as the best answer
Rene@dreamforceRene@dreamforce

Hi, this was not really a helpfull reply, but a good Question.

The error Message is very confusing, because there is no hint what and where the error could be.

 

I had the same Problem..

I had the Situation, that I created two Relationsships to the Contact Class, one call Contact, the other called ReportsTo.

 

 

So the Statement: [SELECT contact__r.name, reportsTo.name FROM  MyObject ...]

was the Problem. The Apex class compiles very well, but when you try to compile a page which accesses this controller, you get this

missleading und not helpfull Error Message.

I'm new to force.com and I know this ist no the Solution but the reason for the message.

FippyFippy

I'm still perplexed by this Unknown Property error. I can't resolve it either:

 

Apex:

 

	public list<ContentVersion> content;
	public list<ContentVersion> getContent()
	{
		if(content==null) {
			list<ContentVersion> cs=new list<ContentVersion>();
			for(ContentVersion c : [Select c.Title, c.RatingCount, c.PositiveRatingCount, c.NegativeRatingCount, c.LastModifiedDate, c.FeaturedContentBoost, c.FeaturedContentDate, c.Description, c.CreatedDate, c.ContentUrl, c.ContentDocumentId 
				From ContentVersion c where (c.FeaturedContentBoost=1)]){
				cs.add(c);
				//system.debug('Content=' + c);
			}
			
			if(cs.size() !=0) { content=cs; }
		}
		return content;
	}

 

Page:

 

    <apex:dataTable value="{!content}" var="cc" columnClasses="mycol ninety,mycol ten" cellpadding="5"
			onRowMouseOver="this.style.background='#efefef'" onRowMouseOut="this.style.background='white'"
			rendered="{!not(isNull(content))}" width="100%">
		<apex:column >
			<a href="/apex/adicioSiteContent?id={!cc.Id}" target="_top">	
			<apex:outputField value="{!cc.Title}" rendered="{!not(isNull(cc))}" /></a>
		</apex:column>
 		<apex:column>
 			<apex:outputField value="{!cc.FeaturedContentDate}" rendered="{!not(isNull(cc))}"/>
 			</apex:column>
	</apex:dataTable>

 

 

ramuduramudu

Hi.

 

Your didi many mistic in class..first mistic is Object name wrong when your r wrting a query in SOQL specify the variable frist