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
FadiShamiFadiShami 

inlineHelpText in a VF page not displaying

I am trying to display the inlineHlpeText on a custome object in a VF page.

 

 

<apex:pageBlockSectionItem helpText="{!$ObjectType.CustomObject__c.Fields.Zip_Postal_Code__c.inlineHelpText}" >

<apex:outputLabel for="ZipCode" value="Zip/Postal Code " />

<apex:inputField id="ZipCode" value="{!content.Zip_Postal_Code__c}"/>

</apex:pageBlockSectionItem>

 

The code above is not working, What am i missing ?

 

I also tried just placing the input field under the pageBlockSection directly, and it still wont display the '?' image with the pop.

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
JimRaeJimRae

According to the documentation:

 

Note that if custom help is defined for the field in Setup, the field must be a child of a pageBlock or pageBlockSectionItem, and the Salesforce page header must be displayed for the custom help to appear on your Visualforce page.To override the display of custom help, use the inputField in the body of a pageBlockSectionItem.

 

So, it won't display if the element is insidea pageblocksectionitem, like you have it, and it wouldn't display if you have the Salesforce page header turned off(showheader=false).

 

 

All Answers

wesnoltewesnolte

Hey

 

You're combining pageblocksectionitem and inputfield. Rather use one or the other. Change your inputfield to an inputText.

 

Your code should also follow this structure,

 

<apex:pageBlock>

<apex:pageBlockSection>

<apex:pageBlockSectionItem helpText="{!$ObjectType.CustomObject__c.Fields.Zip_Postal_Code__c.inlineHelpText}" 

 

Wes 

JimRaeJimRae

According to the documentation:

 

Note that if custom help is defined for the field in Setup, the field must be a child of a pageBlock or pageBlockSectionItem, and the Salesforce page header must be displayed for the custom help to appear on your Visualforce page.To override the display of custom help, use the inputField in the body of a pageBlockSectionItem.

 

So, it won't display if the element is insidea pageblocksectionitem, like you have it, and it wouldn't display if you have the Salesforce page header turned off(showheader=false).

 

 

This was selected as the best answer
FadiShamiFadiShami

i tried inputText instead of inputField - same results !!!

 

FadiShamiFadiShami

Got it - The problem was with showHeader being turned off.

 

So if i want to keep the header off - is there a way around this ? - or will i have to just use regular javascript for the popup help?

JimRaeJimRae
I have not been able to find a way around this.  Either create custom javascript help, or, show the page header.
FadiShamiFadiShami

I came up with a quick hack around it -

 

<apex:pageBlockSectionItem >

<apex:outputLabel for="ZipCode" id="zipcodelabel"

value="Zip/Postal Code ">

<span class="helpButton"> <img class="helpOrb"

style="background-position: right top" src="/s.gif"

alt="{!$ObjectType.custom__c.Fields.Zip_Postal_Code__c.inlineHelpText}"

title="" /> </span>

</apex:outputLabel>

 

<apex:inputText id="ZipCode"

value="{!custom.Zip_Postal_Code__c}" />

</apex:pageBlockSectionItem>

 

This will always display the icon '?' though, and it will use the inlineHelpText provided from the field. You can always add some JS to manipulate the style.