You need to sign in to do that
Don't have an account?
var in <apex:repeat> is case sensitive on me......
Hi there
This is weird.. Never thought I've encountered that before. Is it new...?
The following code works, just as you would expect.
<apex:page standardController="account">
<apex:repeat value="{!account.contacts}" var="CONTACT">
<apex:outputField value="{!CONTACT.name}" />
</apex:repeat>
</apex:page>
However, if I change the outputField to this (only hanged the apex:outputField line),
<apex:page standardController="account">
<apex:repeat value="{!account.contacts}" var="CONTACT">
<apex:outputField value="{!contact.name}" />
</apex:repeat>
</apex:page>
I got this error mssage:
Error: Unknown property 'AccountStandardController.contact'
This is really against what I have believed for a long time that VF is case insensitive.
Has anyone else seen this before?
Note: I originally had var="Contact". My above code, var="CONTACT", is simply for illustrations.
Thanks
king
This is weird.. Never thought I've encountered that before. Is it new...?
The following code works, just as you would expect.
<apex:page standardController="account">
<apex:repeat value="{!account.contacts}" var="CONTACT">
<apex:outputField value="{!CONTACT.name}" />
</apex:repeat>
</apex:page>
However, if I change the outputField to this (only hanged the apex:outputField line),
<apex:page standardController="account">
<apex:repeat value="{!account.contacts}" var="CONTACT">
<apex:outputField value="{!contact.name}" />
</apex:repeat>
</apex:page>
I got this error mssage:
Error: Unknown property 'AccountStandardController.contact'
This is really against what I have believed for a long time that VF is case insensitive.
Has anyone else seen this before?
Note: I originally had var="Contact". My above code, var="CONTACT", is simply for illustrations.
Thanks
king
if I had
<apex:repeat value="{!account.contacts}" var="contact">
though,
I then can have
<apex:outputField value="{!CONTACT.name}" />
So, it's like, if my var in the <apex:repeat> has a capital letter, then the "value" must follow. If the var has a lower case in <apex:repeat>, then it doesn't matter what you have for the "value" attribute within the loop. Very strange.
The only piece of advice I can give you though is you should try not naming a variable the same name as an object. Eventually you will likely run into some issue that will be because of it but waste a lot of time trying to debug. (I know this from experience.)
If someone is still facing this case sensitive and case insensitive dilemma then you can visit this link. They have listed a few things which are case sensitive in salesforce, which proves that it is not completely case-insensitive.