You need to sign in to do that
Don't have an account?
deshaw
Visualforce list doesn't support more than 1000 elements!
I am developing a multi-picklist pop-up window for our need.
The left side has more than 4000 elements.
I am using a controller for dynamically generating the option list. The following code snippet explains this.
In the Program code:
<apex:selectList style="width:220px" size="10" multiselect="true" id="availableList" onfocus="skipcycle=true" onblur="skipcycle=false" ondblclick="onAdd();">
<apex:selectOptions value="{!items_available}"/>
</apex:selectList>
In the controller,
public List<SelectOption> getItems_available()
{
List<SelectOption> options = new List<SelectOption>();
for (Lead_Manager__c lm: [Select Name FROM Lead_Manager__c Where Is_Frequent__c = false and (Name like 'd%' or Name like 'e%' or Name like 'f%') ORDER BY Name ASC])
{
options.add(new SelectOption(lm.Name, lm.Name));
}
return options;
}
This returns a visualforce error., "System.Exception: collection exceeds maximum size: 1001"
Can anyone help on this?
The left side has more than 4000 elements.
I am using a controller for dynamically generating the option list. The following code snippet explains this.
In the Program code:
<apex:selectList style="width:220px" size="10" multiselect="true" id="availableList" onfocus="skipcycle=true" onblur="skipcycle=false" ondblclick="onAdd();">
<apex:selectOptions value="{!items_available}"/>
</apex:selectList>
In the controller,
public List<SelectOption> getItems_available()
{
List<SelectOption> options = new List<SelectOption>();
for (Lead_Manager__c lm: [Select Name FROM Lead_Manager__c Where Is_Frequent__c = false and (Name like 'd%' or Name like 'e%' or Name like 'f%') ORDER BY Name ASC])
{
options.add(new SelectOption(lm.Name, lm.Name));
}
return options;
}
This returns a visualforce error., "System.Exception: collection exceeds maximum size: 1001"
Can anyone help on this?
I have work around for you. Please check: http://kuldeeptyagi.blogspot.com/
All Answers
this is an Apex Code limit
Now I got stuck into this issue too :( ...
And to me Most users still prefer usig AB keys to navigate and Tab key navigation is not that friendly with POPUP windows to sleect Contact/Account. :(
I 'm trying to replace the default Contact Popup Window field with a Dropdown field in VF page but now it seems like IMPOSSIBLE ... Do you have any suggestions in that ? :)
I was thinking of Returning :List<List<Contact>> type object from APEX but HOW can I BIND that object to a SELECTOPTION control in VF ?
Could you please share your code if you got the list of list to work on the VF page? We are facing the same issue, and am pretty much stuck...
Your help would be very much appreciated. Thank you.
:( ... no ... there are limits .. limits .. limits everywhere .. :) ...
The selectoptions VF component cannot store more than 1000, the Apex variable of List type cannot store more than1000, and lastely what i can think of is ...
try to implement something like paging inside dropdowns, if you can do that ... so that you display data in pages of records ...
Visualforce pages are still limited to 1K items in a list BUT Apex lists/set/maps no longer have a limit to their size.
One should be able to work with >1K datasets in a VF page by leveraging a modified StandardSetController, documentation here:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_pages_standardsetcontroller.htm?SearchType=Stem&Highlight=StandardSetController|standardSetController
Still a limit but it's 10K.
I have work around for you. Please check: http://kuldeeptyagi.blogspot.com/
*Add readOnly="true" to exceed your limit from 1000 to 10000