function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Passing selected record ids to Apex controller from another Controller



I would like to pass a List of Records from one Visualforce Page with a custom Controller to another Visualforce Page with a StandardSetController, the same way as it works with Custom Buttons.


I would like to call this page MyPage:

  <apex:form >
     <apex:pageBlock >
       <apex:pageBlockTable value="{!selected}" var="account">
         <apex:column value="{!}"/>


from a Button on another Visualforce Page with this Controller:

public with sharing class myController {
  list<Account> Accounts;

  public PageReference CallOtherVisualforcePageWithListOfAccounts{
    ApexPages.PageReference myRef = Page.MyPage;

    // TODO Pass Accounts to myRef !?!


 Is there a way to accomplish that?