IdeaStandardSetController Class

IdeaStandardSetController objects offer Ideas-specific functionality in addition to what is provided by the StandardSetController.

Namespace

ApexPages

Usage

The IdeaStandardSetController and IdeaStandardController classes are currently available through a limited release program. For information on enabling these classes for your organization, contact your Salesforce representative.

Note

In addition to the method listed above, the IdeaStandardSetController class inherits the methods associated with the StandardSetController.

The methods inherited from the StandardSetController cannot be used to affect the list of ideas returned by the getIdeaList method.

Note

Instantiation

An IdeaStandardSetController object cannot be instantiated. An instance can be obtained through a constructor of a custom extension controller when using the standard list controller for ideas.

Example: Displaying a Profile Page

The following example shows how an IdeaStandardSetController object can be used in the constructor for a custom list controller:
1public class MyIdeaProfileExtension {
2    private final ApexPages.IdeaStandardSetController ideaSetController;
3    
4    public MyIdeaProfileExtension(ApexPages.IdeaStandardSetController controller) {
5        ideaSetController = (ApexPages.IdeaStandardSetController)controller;
6    }
7    
8    public List<Idea> getModifiedIdeas() {
9        Idea[] ideas = ideaSetController.getIdeaList();
10        // modify ideas here
11        return ideas;
12    }
13    
14}
The following Visualforce markup shows how the IdeaStandardSetController example shown above and the <ideas:profileListOutputLink> component can display a profile page that lists the recent replies, submitted ideas, and votes associated with a user. Because this example does not identify a specific user ID, the page automatically shows the profile page for the current logged in user. This page must be named profilePage in order for this example to work:
1<!-- page named profilePage -->
2<apex:page standardController="Idea" extensions="MyIdeaProfileExtension" recordSetVar="ideaSetVar">
3    <apex:pageBlock >
4        <ideas:profileListOutputLink sort="recentReplies" page="profilePage">
5          Recent Replies</ideas:profileListOutputLink>
6        | 
7        <ideas:profileListOutputLink sort="ideas" page="profilePage">Ideas Submitted
8        </ideas:profileListOutputLink>
9        | 
10        <ideas:profileListOutputLink sort="votes" page="profilePage">Ideas Voted
11        </ideas:profileListOutputLink>
12    </apex:pageBlock>
13    <apex:pageBlock >
14        <apex:dataList value="{!modifiedIdeas}" var="ideadata">
15            <ideas:detailoutputlink ideaId="{!ideadata.id}" page="viewPage">
16             {!ideadata.title}</ideas:detailoutputlink>
17        </apex:dataList>
18    </apex:pageBlock>    
19</apex:page>
In the previous example, the <ideas:detailoutputlink> component links to the following Visualforce markup that displays the detail page for a specific idea. This page must be named viewPage in order for this example to work:
1<!-- page named viewPage -->
2<apex:page standardController="Idea">
3    <apex:pageBlock title="Idea Section">
4        <ideas:detailOutputLink page="viewPage" ideaId="{!idea.id}">{!idea.title}
5        </ideas:detailOutputLink>
6        <br/><br/>
7        <apex:outputText>{!idea.body}</apex:outputText>
8    </apex:pageBlock>
9</apex:page>

Example: Displaying a List of Top, Recent, and Most Popular Ideas and Comments

The following example shows how an IdeaStandardSetController object can be used in the constructor for a custom list controller:

You must have created at least one idea for this example to return any ideas.

Note

1public class MyIdeaListExtension {
2    private final ApexPages.IdeaStandardSetController ideaSetController; 
3
4    public MyIdeaListExtension (ApexPages.IdeaStandardSetController controller) {
5        ideaSetController = (ApexPages.IdeaStandardSetController)controller;
6    }
7
8    public List<Idea> getModifiedIdeas() {
9        Idea[] ideas = ideaSetController.getIdeaList();
10        // modify ideas here
11        return ideas;
12    }
13}
The following Visualforce markup shows how the IdeaStandardSetController example shown above can be used with the <ideas:listOutputLink> component to display a list of recent, top, and most popular ideas and comments. This page must be named listPage in order for this example to work:
1<!-- page named listPage -->
2<apex:page standardController="Idea" extensions="MyIdeaListExtension" recordSetVar="ideaSetVar">
3    <apex:pageBlock >
4        <ideas:listOutputLink sort="recent" page="listPage">Recent Ideas
5        </ideas:listOutputLink>
6        | 
7        <ideas:listOutputLink sort="top" page="listPage">Top Ideas
8        </ideas:listOutputLink>
9        | 
10        <ideas:listOutputLink sort="popular" page="listPage">Popular Ideas
11        </ideas:listOutputLink>
12        | 
13        <ideas:listOutputLink sort="comments" page="listPage">Recent Comments
14        </ideas:listOutputLink>
15    </apex:pageBlock>
16    <apex:pageBlock >
17        <apex:dataList value="{!modifiedIdeas}" var="ideadata">
18            <ideas:detailoutputlink ideaId="{!ideadata.id}" page="viewPage">
19             {!ideadata.title}</ideas:detailoutputlink>
20        </apex:dataList>
21    </apex:pageBlock>
22</apex:page>
In the previous example, the <ideas:detailoutputlink> component links to the following Visualforce markup that displays the detail page for a specific idea. This page must be named viewPage.
1<!-- page named viewPage -->
2<apex:page standardController="Idea">
3    <apex:pageBlock title="Idea Section">
4        <ideas:detailOutputLink page="viewPage" ideaId="{!idea.id}">{!idea.title}
5        </ideas:detailOutputLink>
6        <br/><br/>
7        <apex:outputText>{!idea.body}</apex:outputText>
8    </apex:pageBlock>
9</apex:page>