You need to sign in to do that
Don't have an account?
admin 7
I am geeting this Error pls help me, i am posting my code also: Error: locationController Compile Error: unexpected token: 'locationList' at line 2 column 14 in controller
<apex:page controller="locationController">
Location Table <apex:messages style="color:red"></apex:messages>
<apex:form>
<apex:pageblock>
<apex:pageblocktable value="{!locationList}" var="locItem">
<apex:column headervalue="Country">
<apex:inputfield value="{!locItem.Country__c}">
</apex:inputfield>
</apex:column>
<apex:column headervalue="State/Province"> <apex:inputfield value="{!locItem.State__c}">
</apex:inputfield>
</apex:column> <apex:column headervalue="City">
<apex:inputfield value="{!locItem.City__c}"> </apex:inputfield>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page> -
public with sharing class locationController {
public list locationList{get;set;}
public locationController() {
locationList = [Select ID, Country__c, State__c, City__c From student__c];
}
}
Location Table <apex:messages style="color:red"></apex:messages>
<apex:form>
<apex:pageblock>
<apex:pageblocktable value="{!locationList}" var="locItem">
<apex:column headervalue="Country">
<apex:inputfield value="{!locItem.Country__c}">
</apex:inputfield>
</apex:column>
<apex:column headervalue="State/Province"> <apex:inputfield value="{!locItem.State__c}">
</apex:inputfield>
</apex:column> <apex:column headervalue="City">
<apex:inputfield value="{!locItem.City__c}"> </apex:inputfield>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page> -
public with sharing class locationController {
public list locationList{get;set;}
public locationController() {
locationList = [Select ID, Country__c, State__c, City__c From student__c];
}
}
You have not defined what type of data that list (locationList) is supposed to hold.
Please try,
public list<student__c> locationList{get;set;}
Please mark it solved if it helps resolving your issue.
Thanks.