T
- The type of the Items to maintain.public abstract class AbstractCrudItemBean<T extends Serializable> extends Object implements Observer, Serializable
ListDataModel
is
used)
Modifier and Type | Class and Description |
---|---|
class |
AbstractCrudItemBean.DetailItemDelegate
Delegate for the maintenance of a single Item.
|
class |
AbstractCrudItemBean.SearchItemsDelegate
Delegate for searching and sorting of Items.
|
Constructor and Description |
---|
AbstractCrudItemBean()
Public constructor to make this a bean.
|
Modifier and Type | Method and Description |
---|---|
void |
backToSearchItemsListener(javax.faces.event.ActionEvent actionEvent)
When moving to the search page from the detail page, perform a search so
changes at the item level are reflected at the search level.
|
AbstractCrudItemBean.DetailItemDelegate |
getDetailDelegate()
Gets the delegate responsible for CRUD actions on a single Item.
|
protected ItemObservable |
getItemObservable()
Gets the Observable.
|
abstract Class<T> |
getItemType()
Gets the type of the Item to maintain.
|
abstract Searchable |
getSearchCriteria()
Gets the search criteria.
|
AbstractCrudItemBean.SearchItemsDelegate |
getSearchDelegate()
Gets the delegate responsible for search and sort actions.
|
protected javax.faces.event.PhaseListener |
getSearchModePhaseListener()
PhaseListener that checks the request for "searchMode".
|
abstract void |
merge()
Merges the Item.
|
void |
newItemListener(javax.faces.event.ActionEvent actionEvent)
Creates a new instance of the Item and notifies all observers.
|
abstract void |
persist()
Persists the Item.
|
abstract boolean |
remove()
Removes the current Item.
|
void |
removeItemListener(javax.faces.event.ActionEvent actionEvent)
Removes the Item and performs a new search.
|
void |
resetSearchCriteriaListener(javax.faces.event.ActionEvent actionEvent)
Clears the search criteria by calling the search criteria's reset
method.
|
abstract List<T> |
searchItems()
Search for Items.
|
void |
searchItemsListener(javax.faces.event.ActionEvent actionEvent)
Searches for Items.
|
abstract T |
selectItem(Object objectId)
Selects the Item identified by the supplied objectId.
|
void |
selectItemListener(javax.faces.event.ActionEvent actionEvent)
Selects the Item that was selected by the user.
|
abstract void |
sort()
Sorts the Items.
|
void |
submitItemListener(javax.faces.event.ActionEvent actionEvent)
Submits the current Item.
|
void |
update(Observable observable,
Object argument)
.
|
public AbstractCrudItemBean()
public abstract Class<T> getItemType()
public AbstractCrudItemBean.SearchItemsDelegate getSearchDelegate()
public AbstractCrudItemBean.DetailItemDelegate getDetailDelegate()
protected ItemObservable getItemObservable()
public abstract List<T> searchItems()
public abstract Searchable getSearchCriteria()
public abstract void sort()
public abstract void persist()
JsfBeanMode.UPDATE
after a successful persist!public abstract T selectItem(Object objectId)
objectId
- The object ID of the Item.public abstract void merge()
public abstract boolean remove()
public void searchItemsListener(javax.faces.event.ActionEvent actionEvent)
actionEvent
- The ActionEvent.public void resetSearchCriteriaListener(javax.faces.event.ActionEvent actionEvent)
actionEvent
- The ActionEvent.public void newItemListener(javax.faces.event.ActionEvent actionEvent)
JsfBeanMode.NEW
.
actionEvent
- The ActionEvent.public void submitItemListener(javax.faces.event.ActionEvent actionEvent)
JsfBeanMode.NEW
a persist is performed, when
the mode is JsfBeanMode.UPDATE
a merge is performed. Other modes
are simply ignored.actionEvent
- The ActionEvent.public void backToSearchItemsListener(javax.faces.event.ActionEvent actionEvent)
actionEvent
- The ActionEvent.searchItemsListener(ActionEvent)
public void selectItemListener(javax.faces.event.ActionEvent actionEvent)
JsfBeanMode.UPDATE
.
actionEvent
- The ActionEvent.NullPointerException
- When the supplied actionEvent is null.public void removeItemListener(javax.faces.event.ActionEvent actionEvent)
actionEvent
- The ActionEvent.public void update(Observable observable, Object argument)
protected final javax.faces.event.PhaseListener getSearchModePhaseListener()
JsfSearchMode.MAINTENANCE
.Copyright © 2008–2018. All rights reserved.