Interface IItemListModel<T>
- Type Parameters:
T- The type of the encapsulated entity.
- All Superinterfaces:
IUpdatable, Serializable
- All Known Implementing Classes:
AppointmentTemplateListModel, ClientBean.EntityListModelImpl, ClientCounterConfigBean.EntityListModelImpl, ClientResourceBean.EntityListModelImpl, DataSourcesBean.EntityListModelImpl, DbConnectionBean.EntityListModelImpl, DbQueryBean.EntityListModelImpl, EntityListModel, EntityListModelSelectByView, ExternalFormsBean.EntityListModelImpl, FormThemeEditModeSimpleModel, FrontendServerBean.EntityListModelImpl, InboxBean.EntityListModelImpl, ItemListModel, ItemListModelSelectByView, LdapConnectionBean.EntityListModelImpl, LDAPGroupBean.EntityListModelImpl, LdapQueryBean.EntityListModelImpl, MandantFrontendServerBean.EntityListModelImpl, ProjectBean.EntityListModelImpl, ProjectResourceBean.EntityListModelImpl, PromptConnectionListModel, PromptQueryListModel, SystemMessagesBean.EntityListModelImpl, TemplatesBean.EntityListModelImpl, UserBean.EntityListModelImpl, UserGroupBean.EntityListModelImpl, UserRoleBean.EntityListModelImpl
Describes a list of entities of which one can be selected. Mostly used for views with a list of editable entities,
such as a list of files for a project.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given entity to theListof marked entitiesvoidaddNew()Sets the currently selected model to a new model.delete()Deletes the currently selected model from the database.deleteEntity(String targetView, T model) Same asdeleteEntity(Object), but takes the model to be deleted as an argument instead of deleting the currently selected model.deleteEntity(T model) Same asdelete(), but takes the model to be deleted as an argument instead of deleting the currently selected model.voidDeletes all marked entitiesgetAll()booleanbooleanbooleanbooleanisNew()voidCan be overridden to initialize lazily loaded fields on the entity.voidonRowSelect(org.primefaces.event.SelectEvent<?> event) voidonRowSelectCheckbox(org.primefaces.event.SelectEvent<?> event) voidonRowUnselectCheckbox(org.primefaces.event.UnselectEvent<?> event) voidonToggleSelect(org.primefaces.event.ToggleSelectEvent event) voidremoveMarked(T entity) Removes the given entity from theListof marked entitiesvoidsave()Saves the currently selected model to the database.voidsetFiltered(List<T> filtered) Sets the list of filtered models.voidSets the list of marked entitiesvoidsetSelected(T selected) Sets the currently selected model to the given model.voidSets the currently selected from the List of currently marked entitiesvoidRereads the currently model from the database, discarding any local, unsaved changes.Methods inherited from interface IUpdatable
updateData
-
Method Details
-
addMarked
-
addNew
void addNew()Sets the currently selected model to a new model. A new model is not yet persisted in the database and exists only in memory. -
delete
-
deleteEntity
-
deleteEntity
Same asdeleteEntity(Object), but takes the model to be deleted as an argument instead of deleting the currently selected model.- Parameters:
targetView- The name of a view whose view ID is returned after this operation completes successfully. Can also be a relative path, in which case that path is returned.model- The model to be deleted.- Returns:
- A view ID of the page to show after the model was deleted.
-
deleteMarkedEntities
void deleteMarkedEntities()Deletes all marked entities -
getAll
-
getAllPlusNew
-
getFiltered
-
setFiltered
-
getMarked
-
setMarked
-
getSelected
T getSelected()- Returns:
- The currently selected model. A new model if none is selected.
-
setSelected
Sets the currently selected model to the given model. If the given model exists in the database but is not currently managed by an entity manager, rereads the model from the database. Thus thegetSelected()model may not refer to the same instance as the given model.- Parameters:
selected- The model to be selected.
-
hasEntity
boolean hasEntity()- Returns:
trueiff not #isEmptyList()or the currently selected modelisNew().
-
isEmptyList
boolean isEmptyList()- Returns:
trueiffgetAll()is empty.
-
isMarkedDeletable
boolean isMarkedDeletable()- Returns:
trueiff every single marked entity is deletable.falseotherwise
-
isNew
boolean isNew()- Returns:
- Whether the currently selected model is new, ie. whether it is persisted in the database or exists only in memory.
-
loadLazyData
void loadLazyData()Can be overridden to initialize lazily loaded fields on the entity. By default, does not load any lazy data. -
onRowSelect
void onRowSelect(org.primefaces.event.SelectEvent<?> event) -
onRowSelectCheckbox
void onRowSelectCheckbox(org.primefaces.event.SelectEvent<?> event) -
onRowUnselectCheckbox
void onRowUnselectCheckbox(org.primefaces.event.UnselectEvent<?> event) -
onToggleSelect
void onToggleSelect(org.primefaces.event.ToggleSelectEvent event) -
removeMarked
-
save
void save()Saves the currently selected model to the database. If itisNew(), creates a new entry in the database, otherwise updates the existing entry. -
setSelectedFromMarked
void setSelectedFromMarked()Sets the currently selected from the List of currently marked entities -
updateSelected
void updateSelected()Rereads the currently model from the database, discarding any local, unsaved changes. Does nothing iff the currently selected modelisNew().
-