1

I have one requirement. I want to show help Tool Tip of each questions. My scenario is retrieving the questions from Questions object. Help text for question is provided by at the time of questions created. Here help text is custom field. So every question have their own help text. I want to display that help text in beside of every question as tool tip. I write code like this

<apex:pageBlockSection > 
                    <apex:repeat value="{!lstQuestions}" var="c">
                        <apex:pageBlockSectionItem helpText="{!$ObjectType.AM_Question__c.fields.c.Question_Help_Text__c.InlineHelpText}">
                            <apex:outputLabel value="{!c.Question_Label__c} : {!c.Question_Text__c}"/>
                        </apex:pageBlockSectionItem> 
                     </apex:repeat>
</apex:pageBlockSection>

but i got the error:

Error: Unknown property '$ObjectType.AM_Question__c.fields.c'

Can anyone suggest me how to show the tooltip.

  • can you please share the controller code as well? – Rajiv Bhatt Apr 21 '15 at 17:55
0

It looks like you're trying to get AM_Question__c Object's Field, Question, which (based on the number of periods after fields) seems to be a reference to another Object, which you are then looking up another field called Questions_Help_Text__c and then accessing the help text metadata (inside the field) via InlineHelpText.

Is this correct? This seems rather cumbersome and mentions additional Objects/relationships not detailed in your question, which it would be helpful to have explained.

I would think you would just want to do:

{!$ObjectType.c.fields.Question_Help_Text__c.InlineHelpText}
| improve this answer | |
0

does your page have:

showHeader="false"

in the page tag?

doing so will not trigger the javascript to load the help text.

| improve this answer | |
0

In your scenario each question having their own help text in custom field Question_Help_Text__c not in the standard InlineHelpText field.

Your code should be like this:

<apex:pageBlockSection > 
    <apex:repeat value="{!lstQuestions}" var="c">
        <apex:pageBlockSectionItem helpText="{!c.Question_Help_Text__c}">
            <apex:outputLabel value="{!c.Question_Label__c} : {!c.Question_Text__c}"/>
        </apex:pageBlockSectionItem> 
    </apex:repeat>
</apex:pageBlockSection>

If at all you want to access standard help text, this will work:

{!$ObjectType.AM_Question__c.fields[c].inlineHelpText}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.