Newer Version Available
Best Practices for Page Block Components
- Adding More than Two Child Components to <apex:pageBlockSectionItem>
- An <apex:pageBlockSectionItem> component can only have up to two child components. Sometimes, though,
you want to add an extra child component. For example, you may want
to add an asterisk before an <apex:outputLabel> and still display the associated input text field. You can do this
by wrapping the asterisk and output label in an <apex:outputPanel> component,
as follows:
1swfobject.registerObject("clippy.codeblock-1", "9"); 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17<!-- Page: --> 18<apex:page standardController="Account"> 19 <apex:form > 20 <apex:pageBlock title="My Content" mode="edit"> 21 <apex:pageBlockSection title="My Content Section" columns="2"> 22 <apex:pageBlockSectionItem > 23 <apex:outputPanel> 24 <apex:outputText>*</apex:outputText> 25 <apex:outputLabel value="Account Name" for="account__name"/> 26 </apex:outputPanel> 27 <apex:inputText value="{!account.name}" id="account__name"/> 28 </apex:pageBlockSectionItem> 29 </apex:pageBlockSection> 30 </apex:pageBlock> 31 </apex:form> 32</apex:page> 33