I have standard object tab and added object button to VisualForce page on it. The VF have very simple code:
<apex:page standardController="Contract" recordSetVar="Contract">
<apex:pageBlock title="The id of the Contract Standard object">
<apex:pageBlockTable value="{!Contract}" var="a">
<apex:column value="{!a.Status}"/>
<apex:column value="{!a.ContractNumber}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
But when i click the button the VF page display always the last record instead of selected one:
Is there a way to make the VF page display selected record (or records, could be more than one selected) instead of last one?
{!selected}
for the value parameter of the pageBlockTable? It's been years since I played with this stuff but when you use a StandardSetController in Apex it has a separate list of selected records, seems odd that you've only got one and the wrong one though.