+ Start a Discussion
Tamojita GuhasarkarTamojita Guhasarkar 

<apex:dataList > - why and where to use?

Hello Folks, can someone plz explain the benefit of using <apex:dataList > .and some situation where we need to use  <apex:dataList >  ? 

Thanks in Advance ,
Tanoy 
Best Answer chosen by Tamojita Guhasarkar
Leo10Leo10
Hi
The four basic types, apex:pageBlockTable, apex:dataTable, apex:dataList, and apex:repeat are all basically the same thing, but present different renderings.
apex:pageBlockTable represents a table formatted and styled to look like a related list table.
apex:dataTable is an unstyled table suitable for use anywhere outside of a apex:pageBlock (but may be used within one).
apex:dataList renders a ul or ol element (unordered or ordered list, respectively), with li (list item) elements comprising the rows.
apex:repeat allows any arbitrary output based on a template. The four elements require value and var attributes, iterate over a collection of some sort, may generally be nested inside each other, and are limited to 1,000/10,000 rows of output, depending on the apex:page's readOnly attribute.
Edit: As pointed out in the comment, the main difference with apex:pageBlockTable, compared to the other three, is it must appear in a apex:pageBlock or apex:pageBlockSection, while the other types can be rendered anywhere that Visualforce is allowed. There's a very specific limitation about apex:pageBlock not being available in email templates, as well, so you'd naturally have to use one of the other three types of iterators.

also you can refer this link

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_dataList.htm

All Answers

Ramssf70Ramssf70
Hi Tamojita Guhasarkar,
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
<!-- 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;
	}

}

 
Leo10Leo10
Hi
The four basic types, apex:pageBlockTable, apex:dataTable, apex:dataList, and apex:repeat are all basically the same thing, but present different renderings.
apex:pageBlockTable represents a table formatted and styled to look like a related list table.
apex:dataTable is an unstyled table suitable for use anywhere outside of a apex:pageBlock (but may be used within one).
apex:dataList renders a ul or ol element (unordered or ordered list, respectively), with li (list item) elements comprising the rows.
apex:repeat allows any arbitrary output based on a template. The four elements require value and var attributes, iterate over a collection of some sort, may generally be nested inside each other, and are limited to 1,000/10,000 rows of output, depending on the apex:page's readOnly attribute.
Edit: As pointed out in the comment, the main difference with apex:pageBlockTable, compared to the other three, is it must appear in a apex:pageBlock or apex:pageBlockSection, while the other types can be rendered anywhere that Visualforce is allowed. There's a very specific limitation about apex:pageBlock not being available in email templates, as well, so you'd naturally have to use one of the other three types of iterators.

also you can refer this link

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_dataList.htm
This was selected as the best answer
Rodney ChavezRodney Chavez
Learning at institution of higher education is an vital platform in every person's life.
uk essay writing service (https://www.nursingessay.co.uk/" target="_blank)