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
mahesh gadimahesh gadi 

How to Use dataList?

How to complete this challenge using <apex:dataList> iteration component?
Swayam@SalesforceGuySwayam@SalesforceGuy
apex:dataList

An ordered or unordered list of values that is defined by iterating over a set of data. The body of the <apex:dataList> component specifies how a single item should appear in the list. The data set can include up to 1,000 items.

You can use when you want some <ul> <li> HTML interpretation
<!-- Page: -->
<apex:page controller="dataListCon">
    <apex:dataList value="{!accounts}" var="account">
        <apex:outputText value="{!account.Name}"/>
    </apex:dataList>
</apex:page>

/*** Controller: ***/
public class dataListCon {

	List<Account> accounts;

	public List<Account> getAccounts() {
		if(accounts == null) accounts = [SELECT Name FROM Account LIMIT 10];
		return accounts;
	}

}


Hope this helps,

--
Thanks,
Swayam
@salesforceguy