Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have noticed one strange thing about apex:pageBlockSectionItem that if i put a inputField or selectList under pageBlockSectionItem its label gets disappear. I don't know why is this happening? Can anybody explain this.

         <apex:pageBlockSectionItem >
              <apex:outputLabel value="Expiration Date (Mo/Yr)"></apex:outputLabel>
              <apex:pageBlockSectionItem >
              <apex:selectList value="{!expDate}" size="1">
                 <apex:selectOptions value="{!dates}"/>
         <apex:pageBlockSectionItem >

I have find out one work around of this by putting up a outputLabel block just before inputField as shown in above example. can anybody explain the best way to get rid of this problem?

share|improve this question
I am completely new to SF. But, in the code block, is line 3 a typo/paste error? – John Siu Dec 16 '12 at 21:18
up vote 8 down vote accepted

This is not a bug or problem. It works exactly as designed. Here is a piece of official salesforce doc:

Note that if you include an <apex:outputField> or an <apex:inputField> component in an <apex:pageBlockSectionItem>, these components do not display with their label or custom help text

To "workaround" this case if using an <apex:inputField> just use no pageBlockSectionItem and the label will be rendered automatically:

    <apex:inputField value="{!someObj.val__c}" />

In your case i would use this example:

<apex:pageBlockSectionItem >
   <apex:outputLabel value="Expiration Date (Mo/Yr)"/>
   <apex:selectList value="{!expDate}" size="1">
       <apex:selectOptions value="{!dates}"/>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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