1

I don't know why, but the help text and the helptextimage does not appear.

    <apex:pageBlockSectionItem helpText="{!$ObjectType.Opportunity.Fields.StageName.inlineHelpText}">
         <apex:outputLabel value="{!$ObjectType.Opportunity.Fields.StageName.label}" />
         <apex:inputField value="{!oppString.StageName}" />
     </apex:pageBlockSectionItem>

Any ideas?

2 Answers 2

2

Make sure ShowHeader="true" in your page definition, as mentioned in this forum post: https://developer.salesforce.com/forums/?id=906F000000097KUIAY

This is working in my dev org:

<apex:pageBlock>
<apex:pageBlockSection title="Sample Section">
<apex:pageBlockSectionItem helpText="{!$ObjectType.Opportunity.fields.Amount.inlineHelpText}">
             <apex:outputLabel>{!$ObjectType.Opportunity.fields.Amount.Label}</apex:outputLabel>
             <apex:inputField value="{!Opportunity.Amount}" />
       </apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
3
  • 1
    Also make sure you've obviously SET help text for the field ;-) Commented Sep 22, 2015 at 21:24
  • The problem was the showheader attribute, but I don't like the header on this visualforce page. Can I show the helptext without the showheader = true attribute?
    – peXeq
    Commented Sep 23, 2015 at 6:15
  • If you want to do that, you will need to manually add the helpText image, since it won't inherit the style. This forum conversation covers that: developer.salesforce.com/forums?id=906F00000008mXYIAY Commented Sep 23, 2015 at 16:57
0

This is workaround for this.

<span class="helpButton" id="stagename-_help">
                    <apex:outputLabel value="{!$ObjectType.Opportunity.Fields.StageName.label}" />
                    <img id= "stagehelpImg" class="helpOrb" title="" alt="" src="/s.gif"/>
                    <script>
                        sfdcPage.setHelp('stagename', '{!$ObjectType.Opportunity.fields.StageName.inlineHelpText}');
                         var isIE = (navigator.appName.indexOf("Microsoft") != -1);
                         var isIE7 = (navigator.appVersion.indexOf('MSIE 7.')==-1) ? false : true;
                         var helpImg = document.getElementById('stagehelpImg');
                         if(isIE7)
                            helpImg.style.marginRight = "6px";
                         else if(isIE)
                          helpImg.style.marginRight = "0px";
                        else
                          helpImg.style.marginRight = "3px";                         
                 </script>

            </span> <apex:inputField value="{!oppString.StageName}"/>
 </apex:pageBlockSectionItem>

So the basic idea is we need to wrap the label with custom javascript and html which generate same layout.

Some points we consider here

  1. Span id referring img tag attribute id.
  2. sfdcPage.setHelp function refer span id but only first part of -
  3. This code has some layout issues with IE7 so you may need to set margin as per your field.
5
  • I'm not sure that this is the case. A number of people seem to have been able to do it? Commented Sep 22, 2015 at 21:14
  • @AdamMichaelDaw this can be a solution for this problem if your answer doesn't work. we can't completely deny this answer. What I suggested is a workaround.
    – Himanshu
    Commented Sep 22, 2015 at 21:22
  • fair enough, downvote removed. But I feel it overcomplicates the issue if it's unnecessary. Commented Sep 22, 2015 at 21:23
  • I tested first with showheader="true" in vf page and it didn't work. did you tried that?
    – Himanshu
    Commented Sep 22, 2015 at 21:27
  • Of course. And it is working in my dev org. Commented Sep 22, 2015 at 21:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .