function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eric Anderson 54Eric Anderson 54 

Multiple lines in a row of a pageblocktable

I have a user requirement that our current Salesforce object, developed in Visualforce be cleaned up. The 
user requirement is that evidentuary information be captured for a case. Currently, through visualforce, we 
have developed a screen that looks like the followig: (except when it is running, the files address is on the same line as the rest of the information.)

Witness name    Witness phone     Witness address        Witness city    Witness e-mail        Deposed    Deposition file 
Jane Doe    916-555-1212    123 Main Street        Sacramento    Yes     C:/My Documents/Cases/JanedoeDeposition05042017.WMV
John Doe    916-555-1212    123 Main Street        Sacramento    Yes     C:/My Documents/Cases/JohndoeDeposition05042017.WMV
Sue Smith    916-555-1111    133 Main Street        Sacramento    Yes     C:/My Documents/Cases/SuesmithDeposition05042017.WMV
Tom Thumb    916-555-2222    113 Main Street        Sacramento    Yes     C:/My Documents/Cases/tomthumbDeposition05042017.WMV

The section of the code that I am currently using to accomplish the above is similar to this: 
<apex:pageBlockTable value="{!WitnessEntries}" var="entry" id="Entry_Table_List">
                <apex:column width="70" headerValue="Witness name">
                    <apex:inputField value="{!entry.Witness_name__c}"/>
                <apex:column width="60" headerValue="Witness phone">
                    <apex:inputField value="{!entry.Witness_phone__c}"/>
                <apex:column width="20" headerValue="Witness address">
                    <apex:inputField value="{!entry.Witness_address__c}"/>
                <apex:column width="20" headerValue="Witness city">
                    <apex:inputField value="{!entry.Witness_city__c}"/>
                <apex:column width="80" headerValue="Witness e-mail">
                    <apex:inputField value="{!entry.Witness_e-mail__c}"/><br/>
                <apex:column width="80" headerValue="Deposed">
                    <apex:inputField value="{!entry.Deposed__c}"/><br/>
                <apex:column width="80" headerValue="Deposition file">
                    <apex:inputField value="{!entry.Deposition_file__c}"/><br/>

However, what the user wants to see is a form that looks like the following so that it is easier for them to 
digest the information at a glance. 

Witness Name:    Jane Doe       Witness Phone: 916-555-1212    Witness e-mail:
Witness address: 123 Main Street   Witness City:  Sacramento     Witness deposed: Yes 
Witness Deposition File: C:/My Documents/Cases/JanedoeDeposition05042017.WMV

Witness Name:    John Doe       Witness Phone: 916-555-1212    Witness e-mail:    
Witness address: 123 Main Street   Witness City:  Sacramento     Witness deposed: Yes 
Witness Deposition File: C:/My Documents/Cases/JohndoeDeposition05042017.WMV

Witness Name:    Sue Smith       Witness Phone: 916-555-1111    Witness e-mail:    
Witness address: 133 Main Street   Witness City:  Sacramento     Witness deposed: Yes 
Witness Deposition File: C:/My Documents/Cases/SuesmithDeposition05042017.WMV

Witness Name:    Tom Thumb       Witness Phone: 916-555-2222    Witness e-mail:    
Witness address: 113 Main Street   Witness City:  Sacramento     Witness deposed: Yes 
Witness Deposition File: C:/My Documents/Cases/tomthumbDeposition05042017.WMV

Thank you in advance for how I might accomplish this. 


Eric Anderson
Several ways to do it.  You could just to an HTML table and the apex repeat tag.

Something like this...
    <apex:repeat value="{!WitnessEntries}" var="entry}"
            <td>Witness Name: {!entry.Witness_Name__c}</td>
            <td>Witness Phone: {!entry.Witness_PHone__c}</td>
            <td>Witness e-mail: {!entry.Witness_e-mail__c}</td>
            <td>Witness address: {!entry.Witness_address__c}</td>
            <td>Witness City: {!entry.Witness_City__c}</td>
            <td>Witness deposed: {!entry.Deposed__c}</td>
             <td colspan="3">Witness Deposition File: {!entry.Depositio_file__c}</td>

Eric Anderson 54Eric Anderson 54
Hi there Jeffrey,

For the purpose of my question, your answer was pretty much 'Right on'! The only exception was that line '2' of your solution should have been:
<apex:repeat value="{!WitnessEntries}" var="entry"/>

Your solution does present a problem in that the fields are for 'Input' on those elements displayed, but I will dig into that issue and see if I can find the answer to that quandry. (HTML is not my strong suit. :-( )

Thank you very much for your insight!

Eric Anderson