I have a visualforce page which shows list of a custom object records.One column shows the Account name which has lookup relationship with the custom object.I need to add one button in each row and on click this will show the contact records for that account only in a different vf page.I have tried passing the account id in the vf page that I have created for contact list.But it gets redirected to account record. Thanks for help!
<apex:column width="5%" styleClass="mainTableRow">
<apex:facet name="header">/apex:facet>
<apex:panelGrid columns="4" width="100%">
<apex:commandButton value="Show Contacts" action="{!showContacts}">
<apex:param name="accountId" value="{!obj.Account__r.Id}" assignTo="{!accountId}"/>
</apex:commandButton>
</apex:panelGrid>
</apex:column>
</apex:dataTable>