• Lakshey Mendiratta
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have an error with a new Visualforce page I'm creating that takes advantage of a custom controller I made. It is all around custom objects I build, and the class file compiled just fine. But when I start building the Visualforce page it gives me an error that I can't for the life of me figure out.

 

This is the Visual Force Page

 

 

<apex:page controller="TaskTimeEntryController" showHeader="true" sidebar="false">
	<apex:form id="TimeEntryForm">
		<apex:pageBlock >
			<apex:pageBlockSection >
				{!$User.FirstName} {!$User.LastName}
			</apex:pageBlockSection>
			<apex:pageBlockSection >
				<apex:pageBlockTable value="{!lstTasksForUser}" var="lstTasks" width="100%">
					<apex:column HeaderValue="Select">
						<apex:outputText Value="{!lstTasks.Name}"></apex:outputText>
					</apex:column>
				</apex:pageBlockTable>
			</apex:pageBlockSection>
		</apex:pageBlock>
	</apex:form>
</apex:page>

 

 

And the Controller:

 

public class TaskTimeEntryController {
	public List<Task__c> lstTasksForUser = new List<Task__c>();
	public List<Time_Entry__c> lstTimeToEnter = new List<Time_Entry__c>();
	
	public TaskTimeEntryController(){
		populateTaskList();
	}
	
	private void populateTaskList() {
		lstTasksForUser = [
			Select Name, Task_Status__c, Current_Hours__c, Current_End_Date__c, Current_Duration__c, Assigned_To__c, 
				(Select Estimated_Time__c From Future_Time_Entries__r)
			From Task__c 
			WHERE Assigned_To__c = :UserInfo.getUserId()];
	}
	
	public List<Task__c> getUsersTasks() {
		return lstTasksForUser;
	}
}

 

 

The class compiles fine, I'm using the Force.com IDE, so that seems to be okay. But then when I go to save my Visualforce page it gives the following error:

 

Save error: Unknown property 'TaskTimeEntryController.lstTasksForUser'

 

I've looked over a the variable names a bunch of times and even copied another sample that was the same structure and it compiles just fine, but when I change to my objects, error. I'm sure I'm missing something simple.

  • February 14, 2011
  • Like
  • 0