Wednesday 3 April 2013


Visualforce Help Bubbles

I am a big fan of bubble help:

I know, lots of times you really don't have anything useful to say about a field. It is just too obvious, right?Put in some bubble help anyway - it shows you care.
Lots of people don't seem to realize that you can put in bubble help for standard fields as well as custom ones, with a couple of exceptions:
  • Name
  • Created By
  • Last Modified By
Everything else? Needs bubble help.Visualforce pages need bubble help, too. If you use the <apex:inputField> tag, you get your standard bubble help automatically. If you set up your own structure, however, you can still use the built-in bubble help as long as you embed that inside of an <apex:pageBlockSectionItem> tag:

<apex:pageBlockSectionItem helpText="What's my bubble help?">
Even better is if you get the bubble help text directly from the object definition:
<apex:pageBlockSectionItem 
   helpText="{!$ObjectType.Lead.Fields.Product_Interest__c.inlineHelpText}">
With $ObjectType, you can automatically pick up any changes in your bubble help without having to edit your Visualforce page at all.One side note: If you want to use bubble help on a VF page, you need to turn on headers:

<apex:page sidebar="true" showHeader="true" standardStylesheets="true">
(This is the default, so that shouldn't be an issue - except in those cases where you deliberate turn off headers and suddenly all of your bubble help disappears.)
Categories:

0 comments:

Post a Comment

    Links