Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
IdeaStandardSetController Class
Namespace
Usage
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
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}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>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
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}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>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>IdeaStandardSetController Methods
The following are instance methods for IdeaStandardSetController.
getIdeaList()
Signature
public Idea[] getIdeaList()
Return Value
Type: Idea[]
Usage
You can use the <ideas:listOutputLink>, <ideas:profileListOutputLink>, and <ideas:detailOutputLink> components to display profile pages as well as idea list and detail pages (see the examples below). The following is a list of properties returned by this method:
- Body
- Categories
- Category
- CreatedBy.CommunityNickname
- CreatedBy.Id
- CreatedDate
- Id
- LastCommentDate
- LastComment.Id
- LastComment.CommentBody
- LastComment.CreatedBy.CommunityNickname
- LastComment.CreatedBy.Id
- NumComments
- Status
- Title
- VoteTotal