Interface
caplin.grid

GridRowModelListener

GridRowModelListener defines an interface for classes that wish to listen to {@link caplin.grid.GridRowModel GridRowModel} events.

Constructor Summary

Attributes Name and Description
caplin.grid.GridRowModelListener()

Method Summary

Attributes Name and Description
void onAllDataReceived()

This callback is invoked when data has been received for all requested rows

void onRowContentsChanged(Array pIndicies, Object pUpdates)

This call-back is invoked when the content for one or more rows change.

void onRowDataReceived()

This callback is invoked once a response is received for the requested data.

void onRowDataRequested()

This callback is invoked when a request for data has been initiated.

void onRowDataUnavailable(String sReason)

This callback is invoked when the request for data failed, for example due to an issue retrieving data from the server.

void onRowModelStateChanged()

This callback is invoked when the state of the row model has changed such that it is now fundamentally different to its initial configured state.

void onRowStructureChanged(Array pIndicies)

This call-back is invoked when the subject-identifiers for one or more rows change.

void onSizeChanged(int nNewSize, int nOldSize)

This call-back is invoked when the total number of rows available changes — this is not the number being displayed.

void onStartIndexChanged(int nNewStartIndex)

Callback that occurs when the total number of available rows is updated to be smaller than the maximum index currently displayed.

Constructor Detail

caplin.grid.GridRowModelListener()

Method Detail

void onAllDataReceived()

This callback is invoked when data has been received for all requested rows

void onRowContentsChanged(Array pIndicies, Object pUpdates)

This call-back is invoked when the content for one or more rows change.

While the pUpdates attribute contains only those fields that have changed since the last update, you can instead use the caplin.grid.GridRowModel#getRowData method if you need to retrieve the complete list of name/value pairs for any given row.

Parameters
Array pIndicies The list of row indices for which the content has changed.
Object pUpdates A list of name/value pair maps (one for each row index) that contains the field updates for this row.

void onRowDataReceived()

This callback is invoked once a response is received for the requested data.

void onRowDataRequested()

This callback is invoked when a request for data has been initiated.

void onRowDataUnavailable(String sReason)

This callback is invoked when the request for data failed, for example due to an issue retrieving data from the server.

If the request was successful, but did not return any rows, then the #onRowDataReceived method will be invoked followed by #onSizeChanged with a new size of 0.

Parameters
String sReason A brief description of what the error is. The enumeration caplin.grid.RowDataUnavailable provides a list of the possible values.

void onRowModelStateChanged()

This callback is invoked when the state of the row model has changed such that it is now fundamentally different to its initial configured state. A GUI could listen to this event to determine when to show an indication that the grid has changed and needs to be saved for the change to be persisted between sessions.

void onRowStructureChanged(Array pIndicies)

This call-back is invoked when the subject-identifiers for one or more rows change.

Whereas #onRowContentsChanged is used to denote content change within pre-existing subjects, this method signifies that there are data changes, but that they are not updates, but completely new replacement data corresponding to new subjects. The caplin.grid.GridRowModel#getSubjectId method can be used to get the subject identifier corresponding to a particular row.

Parameters
Array pIndicies The list of row indices for which the subject has changed.

void onSizeChanged(int nNewSize, int nOldSize)

This call-back is invoked when the total number of rows available changes — this is not the number being displayed.

Parameters
int nNewSize The new number of rows contained within the grid.
int nOldSize The old number of rows that were contained within the grid. This will be undefined the first time this method is called.

void onStartIndexChanged(int nNewStartIndex)

Callback that occurs when the total number of available rows is updated to be smaller than the maximum index currently displayed.

Parameters
int nNewStartIndex The new start index.