public abstract class RecordActionTable<R extends PersistentRecord> extends ConfigPanel
A RecordActionTable is commonly used in the Configure section of the gateway. It displays a table of each record for
a given record type. By default, it includes edit and delete links next to each record, and an
add link at the bottom. By default, the columns are created by looking at the record's RecordMeta and finding
all fields maked with SFieldFlags.SDESCRIPTIVE
This class is very customizable by subclassing it and overriding functions. Common points of overriding are:
addRecordInstanceActions(RepeatingView, PersistentRecord)
to add new action links next to each
record.addRecordActions(RepeatingView)
To add new links below the table
getCalculatedFields()
to add new columns to the tableModifier and Type | Class and Description |
---|---|
static interface |
RecordActionTable.ICalculatedField<R extends PersistentRecord> |
class |
RecordActionTable.RecordActionTableDelete
Subclass of DeleteRecordaction that delegates canDelete and onDelete to the RecordActionTable
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<org.apache.wicket.Component> |
ajaxUpdatedComponents
A list of components that should get refreshed via ajax.
|
protected IConfigPage |
configPage |
protected boolean |
timerAdded |
feedback, returnPanel
Constructor and Description |
---|
RecordActionTable(IConfigPage configPage)
Creates a RecordActionTable, using a default RecordListModel
|
RecordActionTable(IConfigPage configPage,
org.apache.wicket.model.IModel<? extends java.util.List<? extends PersistentRecord>> model)
Creates a RecordActionTable using a custom model to list the records
|
RecordActionTable(IConfigPage configPage,
java.lang.String id) |
Modifier and Type | Method and Description |
---|---|
protected void |
addRecordActions(org.apache.wicket.markup.repeater.RepeatingView view)
Provides a hook to add record actions, like "Add new.." to the bottom of the panel.
|
protected void |
addRecordInstanceActions(org.apache.wicket.markup.repeater.RepeatingView view,
R record)
Provides an opportunity to add any actions that deal with specific record instances.
|
protected void |
canDelete(R record)
Verifies if a record can be deleted.
|
protected org.apache.wicket.Component |
createFooter(java.lang.String id)
Override this to return a Wicket component to display beneath the table.
|
protected org.apache.wicket.model.IModel<java.util.List<R>> |
createRecordModel(RecordMeta<R> meta) |
protected void |
doDeleteRelatedRecords(PersistenceSession session,
R record)
Provides a chance for subclasses to delete any related records before this record is deleted.
|
protected ConfigPanel |
getActionParentPanel()
Returns the panel that will be used by actions as the parent.
|
protected java.lang.String |
getCalculatedFieldDisplayValue(java.lang.Object value) |
protected java.util.List<RecordActionTable.ICalculatedField<R>> |
getCalculatedFields()
Override this to add calculated fields (columns) to the table.
|
protected java.util.List<SFieldMeta> |
getDescriptiveFields()
Looks through the SFieldMeta's defined by the record's RecordMeta, finding all descriptive fields.
|
protected java.util.Collection<RecordMeta<? extends PersistentRecord>> |
getExemptForeignKeys() |
protected java.lang.String |
getFieldValue(R record,
FormMeta formMeta) |
protected int |
getInstanceActionMaxRowCount()
Returns the maximum number of instance actions per row.
|
protected java.lang.String |
getNoDescriptiveFieldsKey() |
protected java.lang.String |
getNoRowsKey()
Override this to return a custom resource key for what to display when no records exist
|
protected abstract RecordMeta<R> |
getRecordMeta() |
protected java.lang.String |
getTitleKey() |
protected void |
initComponents(org.apache.wicket.model.IModel<? extends java.util.List<? extends PersistentRecord>> model) |
protected org.apache.wicket.markup.html.WebMarkupContainer |
newDeleteRecordAction(java.lang.String id,
R record) |
protected org.apache.wicket.markup.html.WebMarkupContainer |
newEditRecordAction(java.lang.String id,
R record) |
protected org.apache.wicket.markup.html.WebMarkupContainer |
newRecordAction(java.lang.String id)
Creates a link that will navigate to creating a new record.
|
protected void |
onBeforeRender() |
protected void |
onDelete(R record)
Called after a record is successfully deleted
|
protected void |
setupNewRecord(R record)
Provides subclasses a chance to perform initialization on a new instanceof of the record.
|
getHelpResourceKey, getHelpTopicId, getMenuLocation, getMenuPath, getTipLabelKey, getTipLabelModel, getTitleModel, initTitleArea, isEscapeHTMLInTipLabel, isFeedbackEnabled, isTitleVisible, log
getWebPage, getWebRequest, getWebResponse, getWebSession
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onComponentTag, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
protected IConfigPage configPage
protected java.util.List<org.apache.wicket.Component> ajaxUpdatedComponents
protected boolean timerAdded
public RecordActionTable(IConfigPage configPage)
public RecordActionTable(IConfigPage configPage, java.lang.String id)
public RecordActionTable(IConfigPage configPage, org.apache.wicket.model.IModel<? extends java.util.List<? extends PersistentRecord>> model)
protected org.apache.wicket.model.IModel<java.util.List<R>> createRecordModel(RecordMeta<R> meta)
protected abstract RecordMeta<R> getRecordMeta()
protected ConfigPanel getActionParentPanel()
protected java.util.List<SFieldMeta> getDescriptiveFields()
protected void initComponents(org.apache.wicket.model.IModel<? extends java.util.List<? extends PersistentRecord>> model)
protected void onBeforeRender()
onBeforeRender
in class org.apache.wicket.Component
protected int getInstanceActionMaxRowCount()
protected java.lang.String getCalculatedFieldDisplayValue(java.lang.Object value)
protected java.util.List<RecordActionTable.ICalculatedField<R>> getCalculatedFields()
protected org.apache.wicket.Component createFooter(java.lang.String id)
protected void addRecordInstanceActions(org.apache.wicket.markup.repeater.RepeatingView view, R record)
protected org.apache.wicket.markup.html.WebMarkupContainer newEditRecordAction(java.lang.String id, R record)
protected org.apache.wicket.markup.html.WebMarkupContainer newDeleteRecordAction(java.lang.String id, R record)
protected void addRecordActions(org.apache.wicket.markup.repeater.RepeatingView view)
newRecordAction(String)
protected org.apache.wicket.markup.html.WebMarkupContainer newRecordAction(java.lang.String id)
NewRecordAction
protected void setupNewRecord(R record)
protected void canDelete(R record) throws ConfirmedTaskVetoException
ConfirmedTaskVetoException
protected java.util.Collection<RecordMeta<? extends PersistentRecord>> getExemptForeignKeys()
protected void onDelete(R record)
protected void doDeleteRelatedRecords(PersistenceSession session, R record)
protected java.lang.String getNoRowsKey()
protected java.lang.String getNoDescriptiveFieldsKey()
protected java.lang.String getTitleKey()
getTitleKey
in class ConfigPanel