com.vaadin.client.connectors.data.

Class DataCommunicatorConnector.VaadinDataSource

    • Constructor Detail

      • VaadinDataSource

        protected VaadinDataSource()
    • Method Detail

      • requestRows

        protected void requestRows​(int firstRowIndex,
                                   int numberOfRows,
                                   AbstractRemoteDataSource.RequestRowsCallback<elemental.json.JsonObject> callback)

        Description copied from class: AbstractRemoteDataSource

        Triggers fetching rows from the remote data source. The provided callback should be informed when the requested rows have been received.

        Specified by:

        requestRows in class AbstractRemoteDataSource<elemental.json.JsonObject>

        Parameters:

        firstRowIndex - the index of the first row to fetch

        numberOfRows - the number of rows to fetch

        callback - callback to inform when the requested rows are available

      • getRowKey

        public String getRowKey​(elemental.json.JsonObject row)

        Description copied from class: AbstractRemoteDataSource

        Gets a stable key for the row object.

        This method is a workaround for the fact that there is no means to force proper implementations for Object.hashCode() and Object.equals(Object) methods.

        Since the same row object will be created several times for the same logical data, the DataSource needs a mechanism to be able to compare two objects, and figure out whether or not they represent the same data. Even if all the fields of an entity would be changed, it still could represent the very same thing (say, a person changes all of her names.)

        A very usual and simple example what this could be, is an unique ID for this object that would also be stored in a database.

        Specified by:

        getRowKey in class AbstractRemoteDataSource<elemental.json.JsonObject>

        Parameters:

        row - the row object for which to get the key

        Returns:

        a non-null object that uniquely and consistently represents the row object

      • onDropFromCache

        protected void onDropFromCache​(int rowIndex,
                                       elemental.json.JsonObject removed)

        Description copied from class: AbstractRemoteDataSource

        A hook that can be overridden to do something whenever a row has been dropped from the cache. DataSource no longer has anything in the given index.

        Overrides:

        onDropFromCache in class AbstractRemoteDataSource<elemental.json.JsonObject>

        Parameters:

        rowIndex - the index of the dropped row

        removed - the removed row object

      • updateRowData

        protected void updateRowData​(elemental.json.JsonObject rowData)

        Updates row data based on row key.

        Parameters:

        rowData - new row object