Name

ScalarDataModel

Synopsis

This class wraps any Object to expose it as a DataModel with one row for a UIData component.

Class name:

javax.faces.model.ScalarDataModel

Extends:

javax.faces.model.DataModel

Implements:

None

Constructors

public ScalarDataModel()

Creates a new, empty instance.

public ScalarDataModel(Object object)

Creates a new instance wrapping as Object instance.

Methods

public int getRowCount()

Returns 1, or -1 if the object isn’t set.

public Object getRowData()

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

public int getRowIndex()

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

public Object getWrappedData()

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

public boolean isRowAvailable()

Returns true if the object is set and the current row index is 0.

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 Object 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.