You need to sign in to do that
Don't have an account?
Skwal
Can getSelected work with EnhancedList in VF page?
1) I am trying again to get selected rows (with getSelected() on the controller) from an Enhanced list view in a VF page. Am I doing something wrong or is it just not possible to pass the EnhancedList records to a custom controller? It seems that the Enhanced list recordset should be bound to the controller records but I cannot figure out where this should happen.
2) BTW, I also try to change the FilterID in the EnhancedList but it does not refresh properly. Is this a known issue?
Here is the code. Any help would be great.
<apex:page standardController="Contact" extensions="pgContactHomeController" showHeader="true" tabStyle="Contact" recordSetVar="myContacts"> <apex:form > <apex:selectList value="{!FilterID}" size="1"> <apex:actionSupport event="onchange" rerender="listPanel"/> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> </apex:form> <apex:outputPanel layout="block" id="listPanel"> <apex:enhancedList height="300" ListId="{!FilterID}" rowsPerPage="10" id="ContactList" customizable="True" reRender="debugPanel"/> </apex:outputPanel> <apex:outputPanel layout="block" id="debugPanel"> <apex:pageblock id="myBlock"> <apex:outputText value="Records={!recordCount}" /> <br/> <apex:outputText value="Selected={!selectedCount}" /> <br/> <apex:outputText value="FilterID={!FilterID}" /> <br/> </apex:pageblock> </apex:outputPanel> </apex:page>
public with sharing class pgContactHomeController {
private ApexPages.StandardSetController myController;
public pgContactHomeController(ApexPages.StandardSetController stdController) {
this.myController = stdController;
}
public Integer getRecordCount(){
return ((List<Contact>)myController.getRecords()).size();
}
public Integer getSelectedCount(){
return ((List<Contact>)myController.getSelected()).size();
}
public Id getFilterID(){
return (myController.getFilterID());
}
public void setFilterID(ID newID){
myController.setFilterID(newID);
return;
}
}
I am also searching for an answer to this question, does anyone know if this is possible?
yep I am looking for same thing...if there is a solution...
Did you find a solution to do that? I'm trying to do the same thing. I know it is possible cause I saw it working fine in salesforce GUS.
I'm also trying to hide some columns, like the Edit and Del action column. I found a solution with jquery and css but the problem is when the page refreshes the enhanced list (for example when you choose to display more rows per page), it deletes that css rule. Any help will be appreciated.
Thanks.
Lorenzo
I am also looking for a solution ... were you able to solve this problem?
Hi iam working on enahncedlist.
I have an enhancedlist which shows 120 records(for ex), I want to get no of records which are showing in enhancedlist so that I can use that variable to show as horizontal bar with 120 out 200 recods.
If I remove record from enhancedlistas no of records reduces, and It dynamically should update horizontalbar(red bar should show less )
Please help in this regard,,,,
Was anyone able to resolve this?
Anyone find a solution to this?
https://success.salesforce.com/ideaView?id=08730000000g6wLAAQ
I have found this on Jeff Douglas blog: http://blog.jeffdouglas.com/2014/12/12/enhancedlist-visualforce-component/
A snippet from Jeff Douglas blog: Saved me quite some nerves :)