public abstract class NewSupportingLazyController<E extends EntityInterface,M extends NewSupportingLazyModel<E>> extends AbstractLazyController<E,M>
AbstractController.PersistActionclazz, DEFAULT_BUNDLE_NAME, FILTERING, STATEFACESREDIRECTTRUE| Constructor and Description |
|---|
NewSupportingLazyController(Class<E> clazz,
M lazyModel) |
| Modifier and Type | Method and Description |
|---|---|
E |
create(E e)
calls the super and
AbstractEntityController.setNewEntity(org.fryske_akademy.jpa.EntityInterface) with null. |
String |
deleteTitle()
show some usefull info to a user what is about to be deleted
|
boolean |
disableDelete()
delete should be disabled when
toDelete() is null; |
void |
editNew(String table)
Calls
prepareCreate() and either executes newRowOnCurrentPage(java.lang.String) or
newRowOnLastPage(java.lang.String) on the client. |
Serializable |
getRowKey(Serializable id)
return id or -1 for new entity, for the new entity the rowKey will be -1 which makes it visible in a datatable
|
protected boolean |
newOnLastPage()
returns true when
LazyDataModel.getPageSize() <= wrapped datasize. |
protected abstract String |
newRowOnCurrentPage(String table)
javascript to execute when new row is on current page in datatable, called from
editNew(java.lang.String) |
protected abstract String |
newRowOnLastPage(String table)
javascript to execute when new row is on last page in datatable, called from
editNew(java.lang.String) |
void |
prepareCreate()
calls the super if no newEntity is present
|
void |
remove(E entity)
When the entity argument is transient call
AbstractEntityController.setNewEntity(org.fryske_akademy.jpa.EntityInterface) with null
otherwise call AbstractEntityController.destroy(org.fryske_akademy.jpa.EntityInterface) and AbstractEntityController.setSelected(org.fryske_akademy.jpa.EntityInterface)
with null. |
E |
toDelete()
return
AbstractEntityController.getNewEntity() when it isn't null and AbstractEntityController.getSelected() is null, otherwise
return AbstractEntityController.getSelected(). |
complete, getFiltering, getLazyModel, isSyntaxInvalue, isUseOr, setSyntaxInvalue, setUseOrcancelRow, copy, create, create, destroy, destroy, fillCopy, fillNew, filterAndRedirect, getAuditing, getBundleName, getFilters, getFilterString, getFilterValue, getLastChanged, getLastChangedInfo, getNewEntity, getSelected, gotoPageContaining, isRememberTableState, onRowSelect, refreshRow, save, setNewEntity, setRememberTableState, setSelected, updatediacriticsKeyBoard, getCrudReadService, getCrudWriteService, getSecurityContext, persist, persist, persistprotected abstract String newRowOnLastPage(String table)
editNew(java.lang.String)table - protected abstract String newRowOnCurrentPage(String table)
editNew(java.lang.String)table - public void editNew(String table) throws InstantiationException, IllegalAccessException
prepareCreate() and either executes newRowOnCurrentPage(java.lang.String) or
newRowOnLastPage(java.lang.String) on the client.table - InstantiationExceptionIllegalAccessExceptionprotected boolean newOnLastPage()
LazyDataModel.getPageSize() <= wrapped datasize.
In this case the new entity, added in NewSupportingLazyModel.setWrappedData(java.lang.Object), will land on the last page.public void prepareCreate()
throws InstantiationException,
IllegalAccessException
prepareCreate in class AbstractEntityController<E extends EntityInterface>InstantiationExceptionIllegalAccessExceptionpublic Serializable getRowKey(Serializable id)
id - public E create(E e) throws Exception
AbstractEntityController.setNewEntity(org.fryske_akademy.jpa.EntityInterface) with null.create in class AbstractEntityController<E extends EntityInterface>e - Exceptionpublic void remove(E entity) throws Exception
AbstractEntityController.setNewEntity(org.fryske_akademy.jpa.EntityInterface) with null
otherwise call AbstractEntityController.destroy(org.fryske_akademy.jpa.EntityInterface) and AbstractEntityController.setSelected(org.fryske_akademy.jpa.EntityInterface)
with null. Decrements rowCount in the lazymodel and removes the entity from the wrapped dataentity - Exceptionpublic E toDelete()
AbstractEntityController.getNewEntity() when it isn't null and AbstractEntityController.getSelected() is null, otherwise
return AbstractEntityController.getSelected().public boolean disableDelete()
toDelete() is null;public String deleteTitle()
Copyright © 2018 Fryske Akademy. All rights reserved.