Class ItemListModelSelectByView<T,ID>

Type Parameters:
T - Type of the item.
ID - Type of the item ID.
All Implemented Interfaces:
IItemListModel<T>, IUpdatable, Serializable
Direct Known Subclasses:
PromptConnectionListModel, PromptQueryListModel

public abstract class ItemListModelSelectByView<T,ID> extends ItemListModel<T,ID>
Extends the ItemListModel and adds functionality for memorizing the currently selected entity for the duration of the current session. When the user revisits a view, the previous selection is restored. Uses the SelectionBean for storing the selection.
See Also:
  • Constructor Details

    • ItemListModelSelectByView

      public ItemListModelSelectByView()
    • ItemListModelSelectByView

      public ItemListModelSelectByView(EEntityKeySelectionType keyType)
  • Method Details

    • getCurrentViewBean

      @Deprecated public CurrentViewBean getCurrentViewBean()
      Deprecated.
    • getSelectionBean

      public SelectionBean getSelectionBean()
    • setSelected

      public void setSelected(T selected)
      After setting the selected entity to the given entity, stores this selection in the SelectionBean. This allows the selection to be restored when the user revisits the page (during the same session).
      Specified by:
      setSelected in interface IItemListModel<T>
      Overrides:
      setSelected in class ItemListModel<T,ID>
      Parameters:
      selected - The model to be selected.
    • getAllowedViewsForSelection

      @Deprecated protected Set<EViews> getAllowedViewsForSelection()
      Deprecated.
      Returns:
      A set of views for which pre-selection (selectDefault()) is allowed for this model. If empty, no restriction is applied.
    • getSelectionTypeKey

      protected abstract String getSelectionTypeKey()
    • putSelectionToStore

      protected void putSelectionToStore(SelectionBean selectionBean, String key, T selected)
    • readSelectionFromStore

      protected T readSelectionFromStore(SelectionBean selectionBean, String key)
    • retrieveSelection

      protected final T retrieveSelection()
    • selectDefault

      protected void selectDefault()
      First attempts to retrieve the latest selection made by the user from the SelectionBean. Uses the current EViews and, if applicable, current client and project as the key for storing and retrieving the selected entity (ID). This pre-selection is restricted to the getAllowedViewsForSelection(). If no selection can be found, lets the super class choose a default selection.
      Overrides:
      selectDefault in class ItemListModel<T,ID>
    • storeSelection

      protected final void storeSelection(T selected)