I have a pageBlockTable
that loops through a list of objects.
I'm trying add an onRowClick
event so I can use the clicked row as data for a javascript function.
However when saving in the developer console, I'm getting the error :-
(Unknown property 'ContactStandardController.c')
What am I doing wrong, why is it looking at the controller and not the pageBlockTable
var?
<apex:page standardController="Contact" >
<apex:pageBlock>
<apex:pageBlockTable value="{!Contact}" var="c" onRowClick="alert('{!c.Name}');">
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
{!Contact}
is a single instance. It should not be used with<dataTable/>
. It will result nothing. It should be a list.