Project Documentation
Foundation

Description

Similar to dataTable, but does not render a table. Instead the layout attribute controls how each dataRow is rendered.

Screen Shot

datalist

API

component-family javax.faces.Data
renderer-type org.apache.myfaces.List
component-class org.apache.myfaces.custom.datalist.HtmlDataList
renderer-class org.apache.myfaces.custom.datalist.HtmlListRenderer
tag-class org.apache.myfaces.custom.datalist.HtmlDataListTag

Usage

<t:dataList id="String"
               styleClass="CSSClass1"
               itemStyleClass="CSSClass2"
               var="String"
               value="List"
               layout="Constant"
               rowCountVar="int"
               rowIndexVar="int">
    <h:outputText .../>
</t:dataList>
            

Syntax

<t:dataList/>

value - the content of the list, supported types see JSF Spec 4.1.3.
var - a parameter name, under which the current value is set.
rows - the row count.
first - the first element of the list.
layout - [simple|unorderedList|orderedList|grid], simple = for each dataRow all children are simply rendered, unorderedList = the list is rendered as HTML unordered list (= bullet list), orderedList = the list is rendered as HTML ordered list, grid = the list is rendered in a horizontal grid (table) Default: simple.
styleClass - The CSS class used to style the list
itemStyleClass - The CSS class used to style each element of the list (not applicable when layout = simple)
rowIndexVar - a parameter name, under which the current rowIndex is set in request scope similar to the var parameter.
rowCountVar - a parameter name, under which the rowCount is set in request scope similar to the var parameter.
preserveDataModel="{true|false}" - Indicates whether the state for each row should not be discarded before the datalist is rendered again. Setting this to true might be hepful if an input component inside the datalist has no valuebinding and the value entered in there should be displayed again, or if the input component model is not updated. For example, during validation failure, immediate flag short-circuiting, or subForms. This will only work reliable if the datamodel of the datalist did not change either by sorting, removing or inserting rows. You can use HtmlDataList.clearRowStates() or HtmlDataList.deleteRowStateForRow(int deletedIndex) to programically modify the saved row states. Default: false

Instructions

see examples/dataList.jsp for an example!