enhancedList to accept a StandardSetController argument - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
210  Points
Closed - Low Activity
Closed - Low Activity

enhancedList to accept a StandardSetController argument

Accounts & Contacts

It would be a huge benefit to alot of our clients if the enhancedList visualforce component was more configurable.
The following code snippet illustrates what I would like to be able to do for them:

<apex:page standardController="Account" extensions="AccountEnhancedListExtension">
<apex:form>
<apex:enhancedList records="{!accountSetController}" />
<apex:commandButton action="{!doSomethingWithSelected}" value="Do Something" />
</apex:form>
</apex:page>
 
 
public class AccountEnhancedListExtension {
public ApexPages.StandardSetController accountSetController { get; set; }
 
public AccountEnhancedListExtension(ApexPages.StandardController controller) {
accountSetController = new ApexPages.StandardSetController(Database.getQueryLocator([
SELECT
Name,
Industry
FROM
Account
WHERE
NumberOfEmployees > 500]));
}
 
public PageReference doSomethingWithSelected() {
List<Account> selected = (List<Account>)accountSetController.getSelected();
for(Account account : selected) {
account.IsDoneSomething__c = true;
}
update selected;
return Page.another_page;
}
}

This would allow the contents of an enhanced list to be programatically defined, while leveraging the power of sorting, records per page and pagination.
It would also hopefully solve another shortcoming of the dataTable/pageBlockTable which is fixed columns. If this idea is implemented it would be great if the columns of the enhanced list are those queried by the query locator

Merge Idea · Flag

  • Upvotes
  • Downvotes

Ideas

Apps

from AppExchange

Questions

No results found.

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



 

 

Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


 

Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.