Home SALESFORCE How to display the help text on Visualforce Page?

How to display the help text on Visualforce Page?

when we using the apex:inputField and apex:outputField shows their help Text bubble when nested within a pageBlockSection component automatically like:

<apex:pageBlock>
<apex:pageBlockSection>
<apex:pageBlockSectionItem helptext=”{!$ObjectType.Account.Fields.Phone.InlineHelpText}”>
<apex:outputLabel value=”{!$ObjectType.Account.Fields.Phone.Label}” />
<apex:inputField value=”{!Account.Phone}” />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>

Syntax to display the Help Text in VF Page:
{!$ObjectType.objectName__c.Fields.fieldName__c.inlineHelpText}

Here
objectName__c —> SFDC OBJECT API
fieldName__c —> Field API

if we not using the pageBlockSection, then the standard help text bubble is not displayed:

1) If we use “Label” attribute of “apex:outputField” , then helpText bubble is not displayed
2) If we set “showHeader=false”  of <aapex:Page>, in that case also helpText bubbles is not displayed

We can access the help text within an expression by using the respective $ObjectType global variable in visualforce page and here is the example:

<div id=”mainContent”>
Sample helpText bubbles Example
<span>
<img src=”/s.gif” alt=”Help” title=”{!$ObjectType.Account.Fields.Phone.InlineHelpText}”/>
</span>
</div>

By Providing “$ObjectType.Account.Fields.myField__c.inlineHelpText” in <img> tag as TITLE attribute then the helpText will be displayed as ToolTip Text in Image.

Source:

http://www.salesforce.com/docs/developer/pages/Content/pages_compref_pageBlockSectionItem.htm

You may also like

Leave a Comment