Class RecordActionTable<R extends PersistentRecord>
java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.panel.Panel
com.inductiveautomation.ignition.gateway.web.components.ConfigPanel
com.inductiveautomation.ignition.gateway.web.components.RecordActionTable<R>
- All Implemented Interfaces:
- Serializable,- Iterable<org.apache.wicket.Component>,- org.apache.wicket.event.IEventSink,- org.apache.wicket.event.IEventSource,- org.apache.wicket.IConverterLocator,- org.apache.wicket.markup.html.IHeaderContributor,- org.apache.wicket.request.component.IRequestableComponent,- org.apache.wicket.util.IHierarchical<org.apache.wicket.Component>,- org.apache.wicket.util.io.IClusterable
- Direct Known Subclasses:
- ExtensionPointPage,- SmtpSettingsPage
 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 marked with SFieldFlags.SDESCRIPTIVE
 
This class is very customizable by subclassing it and overriding functions. Common points of overriding are:
- Override addRecordInstanceActions(RepeatingView, PersistentRecord)to add new action links next to each record.
- Override addRecordActions(RepeatingView)To add new links below the table
- Override getCalculatedFields()to add new columns to the table
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceclassSubclass ofDeleteRecordActionthat delegates canDelete and onDelete to the RecordActionTable
- 
Field SummaryFieldsFields inherited from class com.inductiveautomation.ignition.gateway.web.components.ConfigPanelfeedback, returnPanelFields inherited from class org.apache.wicket.markup.html.panel.PanelPANELFields inherited from class org.apache.wicket.ComponentENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER
- 
Constructor SummaryConstructorsConstructorDescriptionRecordActionTable(IConfigPage configPage) Creates a RecordActionTable, using a default RecordListModelRecordActionTable(IConfigPage configPage, String id) RecordActionTable(IConfigPage configPage, org.apache.wicket.model.IModel<? extends List<? extends PersistentRecord>> model) Creates a RecordActionTable using a custom model to list the records
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddRecordActions(org.apache.wicket.markup.repeater.RepeatingView view) Provides a hook to add record actions, like "Add new.." to the bottom of the panel.protected voidaddRecordInstanceActions(org.apache.wicket.markup.repeater.RepeatingView view, R record) Provides an opportunity to add any actions that deal with specific record instances.protected voidVerifies if a record can be deleted.protected org.apache.wicket.ComponentcreateFooter(String id) Override this to return a Wicket component to display beneath the table.createRecordModel(RecordMeta<R> meta) protected voiddoDeleteRelatedRecords(PersistenceSession session, R record) Provides a chance for subclasses to delete any related records before this record is deleted.protected ConfigPanelReturns the panel that will be used by actions as the parent.protected Stringprotected org.apache.wicket.model.LoadableDetachableModel<Object>getCalculatedFieldModel(RecordActionTable.ICalculatedField<R> field, R record) protected List<RecordActionTable.ICalculatedField<R>>Override this to add calculated fields (columns) to the table.protected List<SFieldMeta>Looks through the SFieldMeta's defined by the record's RecordMeta, finding all descriptive fields.protected Collection<RecordMeta<? extends PersistentRecord>>protected StringgetFieldValue(R record, FormMeta formMeta) protected intReturns the maximum number of instance actions per row.protected Stringprotected StringOverride this to return a custom resource key for what to display when no records existprotected abstract RecordMeta<R>protected Stringprotected voidinitComponents(org.apache.wicket.model.IModel<? extends List<? extends PersistentRecord>> model) protected org.apache.wicket.markup.html.WebMarkupContainernewDeleteRecordAction(String id, R record) protected org.apache.wicket.markup.html.WebMarkupContainernewEditRecordAction(String id, R record) protected org.apache.wicket.markup.html.WebMarkupContainerCreates a link that will navigate to creating a new record.protected voidprotected voidCalled after a record is successfully deletedprotected voidsetupNewRecord(R record) Provides subclasses a chance to perform initialization on a new instance of of the record.Methods inherited from class com.inductiveautomation.ignition.gateway.web.components.ConfigPanelgetHelpResourceKey, getHelpTopicId, getMenuLocation, getMenuPath, getTipLabelKey, getTipLabelModel, getTitleModel, initTitleArea, isEscapeHtmlInTipLabel, isFeedbackEnabled, isTitleVisible, log, renderHeadMethods inherited from class org.apache.wicket.markup.html.panel.PanelnewMarkupSourcingStrategyMethods inherited from class org.apache.wicket.markup.html.WebMarkupContainergetWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionMethods inherited from class org.apache.wicket.MarkupContaineradd, 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, visitChildrenMethods inherited from class org.apache.wicket.Componentadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, 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, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onComponentTag, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, 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, wrapMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
configPage
 
- 
- 
Constructor Details- 
RecordActionTableCreates a RecordActionTable, using a default RecordListModel
- 
RecordActionTable
- 
RecordActionTablepublic RecordActionTable(IConfigPage configPage, org.apache.wicket.model.IModel<? extends List<? extends PersistentRecord>> model) Creates a RecordActionTable using a custom model to list the records
 
- 
- 
Method Details- 
createRecordModel
- 
getRecordMeta
- 
getActionParentPanelReturns the panel that will be used by actions as the parent. By default is "this", but can be overridden for cases where multiple record action tables are used inside of another panel.
- 
getDescriptiveFieldsLooks through the SFieldMeta's defined by the record's RecordMeta, finding all descriptive fields.
- 
initComponentsprotected void initComponents(org.apache.wicket.model.IModel<? extends List<? extends PersistentRecord>> model) 
- 
onBeforeRenderprotected void onBeforeRender()- Overrides:
- onBeforeRenderin class- org.apache.wicket.Component
 
- 
getInstanceActionMaxRowCountprotected int getInstanceActionMaxRowCount()Returns the maximum number of instance actions per row. If there are more actions than this, then a new column will be started. Default is 3
- 
getCalculatedFieldDisplayValue
- 
getCalculatedFieldModelprotected org.apache.wicket.model.LoadableDetachableModel<Object> getCalculatedFieldModel(RecordActionTable.ICalculatedField<R> field, R record) 
- 
getCalculatedFieldsOverride this to add calculated fields (columns) to the table. Default implementation returns null.
- 
addRecordInstanceActionsprotected void addRecordInstanceActions(org.apache.wicket.markup.repeater.RepeatingView view, R record) Provides an opportunity to add any actions that deal with specific record instances. Default actions are added for edit and delete.
- 
newEditRecordAction
- 
newDeleteRecordAction
- 
addRecordActionsprotected 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. Make sure that the wicket ids of the children are obtained viaview.newChildId(). Default implementation adds a basic "New Record" action (which itself can be customized by overridingnewRecordAction(String)
- 
newRecordActionCreates a link that will navigate to creating a new record. Uses a basicNewRecordAction
- 
setupNewRecordProvides subclasses a chance to perform initialization on a new instance of of the record.
- 
canDeleteVerifies if a record can be deleted. Throw an exception if the record should not be deleted. The default implementation will check defined foreign keys and will throw an error if any records refer to the record in question.- Throws:
- ConfirmedTaskVetoException
 
- 
getExemptForeignKeys
- 
onDeleteCalled after a record is successfully deleted
- 
doDeleteRelatedRecordsProvides a chance for subclasses to delete any related records before this record is deleted. Will be called with an active SimpleORM session.
- 
getNoRowsKeyOverride this to return a custom resource key for what to display when no records exist
- 
getNoDescriptiveFieldsKey
- 
getFieldValue
- 
getTitleKey- Overrides:
- getTitleKeyin class- ConfigPanel
 
 
-