Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ajax4jsf.model
Class ExtendedDataModel<E>

    java.lang.Object
      javax.faces.model.DataModel<E>
          org.ajax4jsf.model.ExtendedDataModel<E>

All Implemented Interfaces:
  java.lang.Iterable<E>

Direct Known Subclasses:
  SequenceDataModel, SerializableDataModel

    public abstract class ExtendedDataModel<E>

extends javax.faces.model.DataModel<E>

Extesion for `DataModel` , for support complex data structure, like tree, spreadsheet etc in iterable components.

Author:
  shura

Constructor Summary
`ExtendedDataModel()`

Method Summary
`abstract java.lang.Object` | `getRowKey()`
`SerializableDataModel` | `getSerializableModel(Range range)` Iteration component can support save data for use at decoding/validation/update phases to avoid unnessesary calls to original models, for example - to avoid requests to database until all data is validated.
`abstract void` | `setRowKey(java.lang.Object key)` Instead of simple `int` for current state selection, this model can use any object for select current data.
`abstract void` | `walk(javax.faces.context.FacesContext context, DataVisitor visitor, Range range, java.lang.Object argument)` Iterate over model by "visitor" pattern, for given range

Methods inherited from class javax.faces.model.DataModel
`addDataModelListener, getDataModelListeners, getRowCount, getRowData, getRowIndex, getWrappedData, isRowAvailable, iterator, removeDataModelListener, setRowIndex, setWrappedData`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ExtendedDataModel

    public ExtendedDataModel()

Method Detail

### setRowKey

    public abstract void setRowKey(java.lang.Object key)

  Instead of simple `int` for current state selection, this model can use any object for select current data. Implementation depend on model, with any restrictions :

  1. key must be `Serializable`.
  2. `Object.toString()` method must return representation compatible with `UIComponent.getClientId(javax.faces.context.FacesContext)`, as far as this string will be appended to clientId of iterator component.

  Parameters:
    `key` - key for select current data, or null for clear selection.

### getRowKey

    public abstract java.lang.Object getRowKey()

  Returns:
    key for selected data or `null`

### getSerializableModel

    public SerializableDataModel getSerializableModel(Range range)

  Iteration component can support save data for use at decoding/validation/update phases to avoid unnessesary calls to original models, for example - to avoid requests to database until all data is validated.

  Returns:

### walk

    public abstract void walk(javax.faces.context.FacesContext context,
                              DataVisitor visitor,
                              Range range,
                              java.lang.Object argument)

  Iterate over model by "visitor" pattern, for given range

  Parameters:
    `context` - current JSF context.
    `visitor` - instance of `DataVisitor`, for process each row.
    `range` - Implementation-specific range of data keys.
    `argument` - Implementation-specific argument
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.