The enhancedList Visualforce component is an awesome little tag that allows you to display a list view on a Visualforce page. One of the cool features is that you create a custom list view, e.g., "Super Special Contacts", and just show those records in the list view by specifying the ID of the list view listId attribute. That way you can setup a tab that just displays this specific list view and not allow the user to select other list views from the picklist (it doesn't display).
The only problem with this approach is that the id for the custom list view that you enter in the listId will most likely change during deployments or in a managed pacakge.
So I created the following Visualforce componenet that you can throw in your Visualforce page and use the name of the custom list view instead of the id. All of the code is available in this gist. Enjoy!
This is the component that provides the enhanced list view functionality. It uses the Apex Controller below.
The Apex Controller for the component simply looks up the Id of the list view by name and returns the Id.
Here's a sample Visualforce page using the component.
And finally, no Salesforce code would be complete without test cases so ...