You need to sign in to do that
Don't have an account?
Using VF to display two columns of data in a page layout
Hi,
I'm using the following VF to display a number of fields in two columns on a page layout:
<apex:page standardController="CW_Order_Line__x" extensions="OrderLine_ShipToInfoCtrlExt" readOnly="true">
<apex:pageBlock >
<apex:pageBlockSection columns="2">
<div class="row">
<div class="col-md-6">
<apex:outputField label="Name" value="{!shipToInfo.Name__c}"/>
<apex:outputField label="Address" value="{!shipToInfo.Ship_to_Address__c}"/>
</div>
<div class="col-md-6">
<apex:outputField label="Day Phone" value="{!shipToInfo.Ship_to_Day_Phone__c}"/>
<apex:outputField label="Night Phone" value="{!shipToInfo.Ship_to_Night_Phone__c}"/>
<apex:outputField label="Email" value="{!shipToInfo.Ship_to_Email__c}"/> </div>
</div>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>
I am getting the data displayed in two columns but the fields are being rendered aphabetically rather than as specified in the code above.
What I'm getting is:
Column 1: Address, Day Phone, Email
Column 2: Name, Night Phone
What I want is:
Column 1: Name, Address
Column 2: Day Phone, Night Phone, Email
Thanks in advance!
I'm using the following VF to display a number of fields in two columns on a page layout:
<apex:page standardController="CW_Order_Line__x" extensions="OrderLine_ShipToInfoCtrlExt" readOnly="true">
<apex:pageBlock >
<apex:pageBlockSection columns="2">
<div class="row">
<div class="col-md-6">
<apex:outputField label="Name" value="{!shipToInfo.Name__c}"/>
<apex:outputField label="Address" value="{!shipToInfo.Ship_to_Address__c}"/>
</div>
<div class="col-md-6">
<apex:outputField label="Day Phone" value="{!shipToInfo.Ship_to_Day_Phone__c}"/>
<apex:outputField label="Night Phone" value="{!shipToInfo.Ship_to_Night_Phone__c}"/>
<apex:outputField label="Email" value="{!shipToInfo.Ship_to_Email__c}"/> </div>
</div>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>
I am getting the data displayed in two columns but the fields are being rendered aphabetically rather than as specified in the code above.
What I'm getting is:
Column 1: Address, Day Phone, Email
Column 2: Name, Night Phone
What I want is:
Column 1: Name, Address
Column 2: Day Phone, Night Phone, Email
Thanks in advance!
When you use pageBlocSection with columns, salesforce introduces a table with four columns
Try without the pageblocksection.
<apex:page standardController="CW_Order_Line__x" extensions="OrderLine_ShipToInfoCtrlExt" readOnly="true"> <apex:pageBlock > <apex:pageBlockSection columns="2"> <apex:outputField label="Name" value="{!shipToInfo.Name__c}"/> <apex:outputField label="Day Phone" value="{!shipToInfo.Ship_to_Day_Phone__c}"/> <apex:outputField label="Address" value="{!shipToInfo.Ship_to_Address__c}"/> <apex:outputField label="Night Phone" value="{!shipToInfo.Ship_to_Night_Phone__c}"/> <apex:pageBlockSectionItem > <!-- empty selectItem--> </apex:pageBlockSectionItem> <apex:outputField label="Email" value="{!shipToInfo.Ship_to_Email__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:page>