Class AbstractFormBuilderExtensionHandler
- All Implemented Interfaces:
ExtensionHandler
,FormBuilderExtensionHandler
- Direct Known Subclasses:
CMSFormBuilderExtensionHandler
,ParentCategorySortExtensionHandler
,TranslationsFormBuilderExtensionHandler
- Author:
- Kelly Tisdell, Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
enabled, priority
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalAdornedFormActions
(EntityForm entityForm) Provides a hook to add additional actions to adorned entity forms.addAdditionalFormActions
(EntityForm entityForm) Provides a hook to add additional actions to all entity forms.Invoked whenever a detailedEntityForm
is built, after the initial list grids have been created on the givenEntityForm
.modifyListGrid
(String className, ListGrid listGrid) Provides a hook to modify the ListGrid for the given className when building an entityForm.modifyListGridRecord
(String className, ListGridRecord record, Entity entity) Provides a hook to modify the ListGridRecord for the given Entity while building the list grid record.modifyPopulatedEntityForm
(EntityForm ef, Entity entity) Modifies anEntityForm
after it has been populated with anEntity
.Modifies anEntityForm
before it is populated with anEntity
.Methods inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
getPriority, isEnabled, setEnabled, setPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
getPriority, isEnabled
-
Constructor Details
-
AbstractFormBuilderExtensionHandler
public AbstractFormBuilderExtensionHandler()
-
-
Method Details
-
modifyUnpopulatedEntityForm
Description copied from interface:FormBuilderExtensionHandler
Modifies anEntityForm
before it is populated with anEntity
. This method is invoked after all of theEntityForm
fields have been created with the appropriate metadata, but the values have not been set. An example invocation occurs when creating the 'add' form from a collection list grid. Note that this is invoked every time that anEntityForm
is created, whether it is from a "main" entity (when clicking to view the details screen for an entity from from an admin section) or when building an 'add' or 'edit' form for a related list grid from the detail view for an entity.Example usages of this method would be to modify the display for certain fields for a particular
EntityForm
.This method is invoked on every
EntityForm
that is built from the admin (both initial creation with empty field values and populating with real values from anEntity
).Also, it's important to note that in most cases you do not need to implement both this method and
FormBuilderExtensionHandler.modifyPopulatedEntityForm(EntityForm, Entity)
. It is usually sufficient to only modify one or the other. In fact, in some cases (like on a validation failure or when viewing the details for an entity) both this method andFormBuilderExtensionHandler.modifyPopulatedEntityForm(EntityForm, Entity)
are invoked (this method is invoked first)This methods is always invoked before
FormBuilderExtensionHandler.modifyPopulatedEntityForm(EntityForm, Entity)
.- Specified by:
modifyUnpopulatedEntityForm
in interfaceFormBuilderExtensionHandler
- Parameters:
ef
- theEntityForm
that has not yet been populated with values from an entity- Returns:
-
modifyPopulatedEntityForm
Description copied from interface:FormBuilderExtensionHandler
Modifies anEntityForm
after it has been populated with anEntity
. This is invoked after not only all of theEntityForm
fields have been created but theEntityForm
field values have been actually populated with the real values from the givenEntity
. An example of when this method is invoked is after validation has failed (on anyEntityForm
from the admin) or when viewing the details for an entity.This method is not invoked on the creation of every single
EntityForm
but rather only on the cases presented above. If you need functionality for every case that a particularEntityForm
could be built, you should probably implement theFormBuilderExtensionHandler.modifyUnpopulatedEntityForm(EntityForm)
method instead.This method is very similar to
FormBuilderExtensionHandler.modifyUnpopulatedEntityForm(EntityForm)
and usually implementors will only override one or the other.This method is always invoked after
FormBuilderExtensionHandler.modifyUnpopulatedEntityForm(EntityForm)
.- Specified by:
modifyPopulatedEntityForm
in interfaceFormBuilderExtensionHandler
- Parameters:
ef
- theEntityForm
being populatedentity
- theEntity
that theEntityForm
has used to populate all of the values for its fields- Returns:
- whether or not it was handled
-
modifyDetailEntityForm
Description copied from interface:FormBuilderExtensionHandler
Invoked whenever a detailedEntityForm
is built, after the initial list grids have been created on the givenEntityForm
. This allows for further display modifications to the relatedListGrids
that could occur on anEntityForm
, or to only modify anEntityForm
when it is showing an entity in a details viewA detailed
EntityForm
is built when clicking on a row from the mainListGrid
in anAdminSection
or when viewing the details for an entity in a read-only.As far as order of operations are concerned, this is always invoked after
FormBuilderExtensionHandler.modifyPopulatedEntityForm(EntityForm, Entity)
, which is invoked afterFormBuilderExtensionHandler.modifyUnpopulatedEntityForm(EntityForm)
. This means that this method is invoked last and can override values from the previous methods- Specified by:
modifyDetailEntityForm
in interfaceFormBuilderExtensionHandler
- Parameters:
ef
- theEntityForm
that has been built with all- Returns:
- whether or not it was handled
-
modifyListGridRecord
public ExtensionResultStatusType modifyListGridRecord(String className, ListGridRecord record, Entity entity) Description copied from interface:FormBuilderExtensionHandler
Provides a hook to modify the ListGridRecord for the given Entity while building the list grid record.- Specified by:
modifyListGridRecord
in interfaceFormBuilderExtensionHandler
- Returns:
- whether or not it was handled
-
addAdditionalFormActions
Description copied from interface:FormBuilderExtensionHandler
Provides a hook to add additional actions to all entity forms.
For order of operation purposes, this is the last thing that is run when building an entity form, which means that it occurs after
FormBuilderExtensionHandler.modifyDetailEntityForm(EntityForm)
.- Specified by:
addAdditionalFormActions
in interfaceFormBuilderExtensionHandler
- Returns:
- whether or not it was handled
-
modifyListGrid
Description copied from interface:FormBuilderExtensionHandler
Provides a hook to modify the ListGrid for the given className when building an entityForm.- Specified by:
modifyListGrid
in interfaceFormBuilderExtensionHandler
- Returns:
- whether or not it was handled
-
addAdditionalAdornedFormActions
Description copied from interface:FormBuilderExtensionHandler
Provides a hook to add additional actions to adorned entity forms.
For order of operation purposes, this is the last thing that is run when building an entity form, which means that it occurs after
FormBuilderExtensionHandler.modifyDetailEntityForm(EntityForm)
.- Specified by:
addAdditionalAdornedFormActions
in interfaceFormBuilderExtensionHandler
- Returns:
- whether or not it was handled
-