You need to sign in to do that
Don't have an account?
hoagieryder
Using Icons from Recent Items in Visualforce Page
I am generating a list of accounts in a Visualforce Page and I am trying to style it like the Recent Items list. Is there a way to access the icons, ie if the item on the list is an Account than a folder appears next to it? I have found where the image is stored but its appears as one larger image with all the icons(contact, opportunity, etc.) in it. Any ideas?
That is in fact how icons in Salesforce.com work -- it's one big image and they use a CSS offset to show just a little piece of it. That way the browser requests and caches just one big image rather than a whole bunch of little ones. It's actually fairly common.
You can use that big image and the CSS offsets too. Just use Firebug's inspector, mouse over one of those icons, and see the CSS in the area. Note that there's no guarantee that those icons won't change suddenly and mess you up though, so be forewarned about that.
Hi,
I would suggest a similar approach, but slightly modified.
Use CSS classname directly which is used by Salesforce. For example, 'personaccountMru' is the className used for Person Account in recent items.
Example Code:
<div class="mruItem">
<a href="#" class="personaccountMru">
<img title="Account" class="mruIcon" alt="Account" src="/s.gif" />
Sample Account
</a>
</div>
For remaining objects too, you can easily get the class names using firebug or anyother developer tool.. :)
Have fun