Name

ListDataModel

Synopsis

This class wraps a java.util.List to expose it as a DataModel for a UIData component.

Class name:

javax.faces.model.ListDataModel

Extends:

javax.faces.model.DataModel

Implements:

None

Constructors

public ListDataModel()

Creates a new, empty instance.

public ListDataModel(java.util.List list)

Creates a new instance wrapping a List instance.

Methods

public int getRowCount()

Returns the size of the list, or -1 if the list isn’t set.

public Object getRowData()

Returns the list element for the current row index or null if the list isn’t set or there’s no such element.

public int getRowIndex()

Returns the zero-based index for the current row or -1 if no row is selected.

public Object getWrappedData()

Returns the List object or null if the list isn’t set.

public boolean isRowAvailable()

Returns true if the list is set and the current row index is between 0 and the last index of the list.

public void setRowIndex(int index)

Sets the zero-based index for the current row or to -1 if no row is selected.

public void setWrappedData(Object data)

Sets the List instance.

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.