You need to sign in to do that
Don't have an account?

apex:pageBlockSectionItem align labels within a column
Here's something that would have saved me some time if I had found it by searching. I have a pageBlockSection with two columns, and I wanted to include two fields in one column with a single label applied to both fields, just like the Contact Edit page where the label "First Name" appears before the Salutation and FirstName fields.
Only the label was not aligning with the other labels in the same column, until I tried the following. To my surprise, VF didn't recognize this as more than two child components. Hope it helps someone!
<apex:pageBlockSectionItem >
<apex:outputLabel value="First Name"/>
<apex:inputField value="{!Contact.Salutation}">
<apex:inputField value="{!Contact.FirstName}"/>
</apex:inputField>
</apex:pageBlockSectionItem>
Hey,
Yes, you're right. I usually do this when I have more than two components inside a pageblocksection item.
<apex:pageBlockSectionItem >
<apex:outputLabel value="First Name"/>
<apex:outputPanel >
<apex:inputField value="{!con.Salutation}"/>
<apex:inputField value="{!con.FirstName}"/>
</apex:outputPanel>
</apex:pageBlockSectionItem>
Bind them inside some container, so you end up having only two child components for the pageblocksectionItem :)
The above code is working fine ..thanks.:)