I have 2 objects with a lookup relationship. Let say account and contact.

I want to display one account with related contacts per page. One click of next, will display the next account and contacts. How can I achieve this without pagination?

                  <apex:commandLink action="{!navigate}" value="{!h.name}">
                        <apex:param name="qno" value="{!h.Id}"
                            assignTo="{!variable}" />

You can use the above pattern of command link to assign the next Id and bring back the result back to page through ajax or normal getters and setters

Edit Indexing Code as per request

   acc.indexed =i;

Prefer wrapper if you are using only for vf page

  • How can i assign next record ID?
    – Reddy
    Jul 19 '13 at 11:09
  • index the field when queried through wrapper . Jul 19 '13 at 11:29
  • can you please post pseudo code for indexing?
    – Reddy
    Jul 19 '13 at 11:45
  • @Reddy Edited to include rough example Jul 19 '13 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.