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
NewbyNewby 

URGENT : display columns as rows in pageblock table

I have been able to fetch the records from the list and display them in a pageblock,

I want to display the !officeLoc.Office_Name__c and !officeLoc.State__c one below the other instead of next to each other.


as below

!officeLoc.Office_Name__c and
!officeLoc.State__c

 

My VF page :

 

<apex:page controller="infoController" action="{!loadInfoDetails}" showHeader="false" sidebar="false" >

<apex:form >
<apex:outputLink value="{!$Site.Prefix}/secur/logout.jsp" rendered="{!NOT(ISPICKVAL($User.UserType,'Guest'))}">{!$Label.site.logout}</apex:outputLink>
<apex:pageBlock >
<apex:pageblock title="My Info">
<apex:pageblocksection title="Personal Details">
<apex:pageblocksectionitem >
    <apex:outputLabel for="txtUName">User Name</apex:outputLabel>
    <apex:inputText id="txtUName" value="{!objUser.Username}"/>
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
    <apex:outputLabel for="txtEmail">User Email</apex:outputLabel>
    <apex:inputText id="txtEmail" value="{!objUser.Email}"/>
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
    <apex:outputLabel for="txtFirstName">First Name</apex:outputLabel>
    <apex:inputText id="txtFirstName" value="{!objUser.FirstName}"/>
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
    <apex:outputLabel for="txtLastName">Last Name</apex:outputLabel>
    <apex:inputText id="txtLastName" value="{!objUser.LastName}"/>
</apex:pageblocksectionitem>
</apex:pageblocksection>
</apex:pageBlock>

<apex:pageBlock mode="edit" title="Office Locations">
    <apex:pageBlockTable columns="1" value="{!objUser.Office_Location__r}" var="officeLoc"> 
       <apex:column >
           <apex:outputLabel for="txtoffName">Office Name</apex:outputLabel>
           <apex:inputText id="txtoffName" value="{!officeLoc.Office_Name__c}"/>
       </apex:column>
       
       <br> </br>
       <apex:column >
           <apex:outputLabel for="txtstate">State</apex:outputLabel>
           <apex:inputText id="txtstate" value="{!officeLoc.State__c}"/>
       </apex:column>
       
       </apex:pageBlockTable>
       
    

</apex:pageblock>
</apex:pageBlock>
</apex:form>

</apex:page>


bob_buzzardbob_buzzard

I wrote a blog post on a very similar topic at:

 

http://bobbuzzard.blogspot.co.uk/2010/09/rotating-visualforce-table.html