Interface Fetchable<T extends Component<?>>

Type Parameters:
T - The component type
All Known Implementing Classes:
ActivityStream, Calendar, ComboboxItem, DualListBox, ListGrid, RadioButtonItem, Sparkline, Timeline, Treeview

public interface Fetchable<T extends Component<?>>
Interface for marking components that can fetch data.
Since:
4.0
Author:
JBStrap
  • Method Details

    • fetch

      List<Record> fetch(int startRow, int endRow, Criteria criteria, List<Order> orders, Client client) throws FindException, DataAccessException
      This method implements actual data retrieval. The fetchData() function runs callback methods on the returned records.
      Parameters:
      startRow - The first row of the query that appears in the returned list
      endRow - The last row of the query that appears in the returned list
      criteria - The criteria used during the query If null, no criteria will be used, every record is queried.
      orders - The orderings that will be applied to the query results. If null, the data will not be ordered.
      client - The client that started the query. If null, the query will happen without checking for access rights.
      Returns:
      The list of records that meet the specified filter criteria.
      Throws:
      FindException - Occurs if an error was encountered during the query
      DataAccessException - Occurs if the user in the specified client has no access to read the data
    • fetchData

      T fetchData()
      Fetches data
      Returns:
      The component
    • setAutoFetchData

      T setAutoFetchData(boolean autoFetch)
      Sets if the component can fetch data from the database automatically. By default, the fetch is automatic.
      Parameters:
      autoFetch - If true, then the auto fetch is enabled. If disabled, the query must be started manually, through code.
      Returns:
      The component
    • isAutoFetchData

      boolean isAutoFetchData()
      Determines if the component can fetch data from the database automatically.
      Returns:
      If true, then the auto fetch is enabled.
    • addFetchDoneHandler

      default T addFetchDoneHandler(FetchDoneEventHandler handler)
      Adds a fetch done handler to the component. The event will run if the component finishes a data fetch.
      Parameters:
      handler - The FetchDoneEventHandler implementation
      Returns:
      The component
    • fireFetchDoneEvent

      default void fireFetchDoneEvent(Throwable e)
      Fires a fetch done event on the component with the specified error class. If the fetch was successful, it must be specified as null
      Parameters:
      e - The error that occurred during the query, or if the query was successful, null