function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mikhail Nitko 5Mikhail Nitko 5 

Bug in <apex:enhancedList /> when targetting the same object for multiple List Views?

Hi folks,

I'm trying to create a sort of "Master Case" window in Visualforce, that shows 3 List Views of the same Cases object.

I'm using the following code to do this.
 
<apex:page>
  <apex:enhancedList type="Case" height="300" rowsPerPage="25" id="Walk_in_Line" customizable="false" />
  <apex:enhancedList type="Case" height="300" rowsPerPage="25" id="Web_Cases" customizable="false" />
  <apex:enhancedList type="Case" height="300" rowsPerPage="50" id="MyOpenCases" customizable="false" />
</apex:page>
And you can see where I'm targetting the same Object, but using a different ID each time, to target different List Views.

The problem is that when the window finaly opens, each of the List Views is set to view the last List View ID that I used.  Meaning that I get a window with 3 List Views, but they're all set to "MyOpenCases".

Is this a bug or am I doing something wrong?

Thank you for any help!
Best Answer chosen by Mikhail Nitko 5
SonamSonam (Salesforce Developers) 
Hi Mikhali,

This doesn't seem to be a bug.

The ID you have in the parameter should ideally be the 15 digit number you see when you try to edit the list view.
I tried the similar code, just made a couple of changes in the way you are accessing the IDs in the enhancedlist.

<apex:page >
  <apex:enhancedList type="Case" height="300" rowsPerPage="25" listid="00B28000009ocqb" customizable="false" /> //ID recieved from the edit list view page
  <apex:enhancedList type="Case" height="300" rowsPerPage="50" listid="00B28000009ocpJ" customizable="false" />
  <apex:enhancedList type="Case" height="300" rowsPerPage="25" listid="00B28000009ocpl" customizable="false" />
</apex:page>

Hope this helps!
 

All Answers

SonamSonam (Salesforce Developers) 
Hi Mikhali,

This doesn't seem to be a bug.

The ID you have in the parameter should ideally be the 15 digit number you see when you try to edit the list view.
I tried the similar code, just made a couple of changes in the way you are accessing the IDs in the enhancedlist.

<apex:page >
  <apex:enhancedList type="Case" height="300" rowsPerPage="25" listid="00B28000009ocqb" customizable="false" /> //ID recieved from the edit list view page
  <apex:enhancedList type="Case" height="300" rowsPerPage="50" listid="00B28000009ocpJ" customizable="false" />
  <apex:enhancedList type="Case" height="300" rowsPerPage="25" listid="00B28000009ocpl" customizable="false" />
</apex:page>

Hope this helps!
 
This was selected as the best answer
Mikhail Nitko 5Mikhail Nitko 5
Thank you! .. there are two things you changed though that I would have missed if you didn't say it.  The "ID" property you're calling, you're calling "listid" .. while I'm calling just "id".  And that is where I was going wrong, because the SFDC page that shows how to use enhancedList, has the example using just "ID" and the name of the list view being the list view's Unique Name.

So in conclusion, using pure IDs, and the "listid" field is the way to go.

Thank you Sonam!