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
bcgbcg 

Extracting Field values column wise in a table

I need to  get all feild values of rows in the columns of a table i.e as table heading.

 

 

can anybody esnd code to do this via a simple table or datatable or pageblock table etc..

 

 

 

 

GoldwinGoldwin

 

<!-- For this example to render properly, you must associate the Visualforce page 

with a valid account record in the URL.

For example, if 001D000000IRt53 is the account ID, the resulting URL should be:

https://Salesforce_instance/apex/myPage?id=001D000000IRt53

See the Visualforce Developer's Guide Quick Start Tutorial for more information. -->



<!-- Page: -->

<apex:page controller="dataTableCon" id="thePage">

<apex:dataTable value="{!accounts}" var="account" id="theTable" rowClasses="odd,even"

styleClass="tableClass">

<apex:facet name="caption">table caption</apex:facet>

<apex:facet name="header">table header</apex:facet>

<apex:facet name="footer">table footer</apex:facet>

<apex:column>

<apex:facet name="header">Name</apex:facet>

<apex:facet name="footer">column footer</apex:facet>

<apex:outputText value="{!account.name}"/>

</apex:column>

<apex:column>

<apex:facet name="header">Owner</apex:facet>

<apex:facet name="footer">column footer</apex:facet>

<apex:outputText value="{!account.owner.name}"/>

</apex:column>

</apex:dataTable>

</apex:page>



/*** Controller: ***/



public class dataTableCon {



List<Account> accounts;



public List<Account> getAccounts() {

if(accounts == null) accounts = [select name, owner.name from account limit 10];

return accounts;

}

}