Class ListGridAction
java.lang.Object
org.broadleafcommerce.openadmin.web.form.component.ListGridAction
- All Implemented Interfaces:
Cloneable
Buttons to display on the frontend for a list grid. These will be displayed at the top of the
ListGrid that they
are related to.- Author:
- Andre Azzolini (aazzolini)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringstatic final Stringprotected Booleanstatic final Stringprotected Stringprotected Stringprotected Stringstatic final Stringprotected Booleanstatic final Stringprotected Stringprotected Booleanstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Booleanstatic final Stringprotected Booleanstatic final Stringstatic final Stringstatic final Stringprotected Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns an Id that controllers can use to manipulate this action.Returns a fully qualified ceiling entity that this listgrid action targetsGets the manual override for the data-actionurl attribute on an action.If a list grid action should be disabled unless there are one or more rows in the grid, this property should be truevoidsetActionTargetEntity(String actionTargetEntity) This is used to specify a target entityType for use in listgrid actionsvoidsetActionUrlOverride(String actionUrlOverride) This is a manual override for the data-actionurl attribute for an listgrid action.voidsetAllCapable(Boolean allCapable) Sets whether or not the given list grid action is capable of acting on rows even when none are selectedvoidsetButtonClass(String buttonClass) Main intent is for the button class to be used in a JQuery selector for giving this button a click action.voidsetConfirmEnabledText(String confirmEnabledText) voidsetDisplayText(String displayText) voidsetForListGridReadOnly(Boolean forListGridReadOnly) voidsetIconClass(String iconClass) Icon classes are displayed next to thegetDisplayText().voidsetIsConfirmEnabled(Boolean confirmEnabled) voidsetRequiresNonEmptyGrid(Boolean requiresNonEmptyGrid) voidsetSingleActionOnly(Boolean singleActionOnly) Sets where or not this action can only be performed on a single item.voidsetUrlPostfix(String urlPostfix) This means different things depending on where this action is on the list grid.withActionTargetEntity(String actionTargetEntity) withActionUrlOverride(String actionUrlOverride) withAllCapable(Boolean allCapable) withButtonClass(String buttonClass) withConfirmEnabledText(String confirmEnabledText) withDisplayText(String displayText) withForListGridReadOnly(Boolean forListGridReadOnly) withIconClass(String iconClass) withIsConfirmEnabled(Boolean isConfirmEnabled) withRequiresNonEmptyGrid(Boolean requiresNonEmptyGrid) withSingleActionOnly(Boolean singleActionOnly) withUrlPostfix(String urlPostfix)
-
Field Details
-
ADD
- See Also:
-
GEN_SKUS
- See Also:
-
REMOVE
- See Also:
-
UPDATE
- See Also:
-
MANUAL_FETCH
- See Also:
-
REFRESH
- See Also:
-
VIEW
- See Also:
-
EDIT
- See Also:
-
TREE_ADD
- See Also:
-
TREE_JUMP_TO_CONTEXT
- See Also:
-
SINGLE_SELECT
- See Also:
-
MULTI_SELECT
- See Also:
-
ASSET_ADD
- See Also:
-
buttonClass
-
urlPostfix
-
iconClass
-
displayText
-
actionId
-
forListGridReadOnly
-
actionUrlOverride
-
allCapable
-
singleActionOnly
-
actionTargetEntity
-
requiresNonEmptyGrid
-
isConfirmEnabled
-
confirmEnabledText
-
-
Constructor Details
-
ListGridAction
-
-
Method Details
-
withButtonClass
-
withUrlPostfix
-
withIconClass
-
withRequiresNonEmptyGrid
-
withDisplayText
-
withForListGridReadOnly
-
withActionUrlOverride
-
withAllCapable
-
withSingleActionOnly
-
withActionTargetEntity
-
withIsConfirmEnabled
-
withConfirmEnabledText
-
getButtonClass
-
setButtonClass
Main intent is for the button class to be used in a JQuery selector for giving this button a click action. You could technically also apply additional styling to this anchor but is not usually recommended.An example JQuery selector would look like: $('body').on('click', 'button.some-class', function() { doSomeFunction() });
- Parameters:
buttonClass-
-
getForListGridReadOnly
-
setForListGridReadOnly
-
getUrlPostfix
-
setUrlPostfix
This means different things depending on where this action is on the list grid.- If this is a toolbar action: this postfix will be appended onto the end of
ListGrid.getPath()and presented as a 'data-actionurl' attribute for the button - This postfix will also be presented as a 'data-urlpostfix' attribute on the button
- Parameters:
urlPostfix-
- If this is a toolbar action: this postfix will be appended onto the end of
-
getIconClass
-
setIconClass
Icon classes are displayed next to thegetDisplayText(). These can technically be whatever you like and you can use css selectors to style them accordingly. That said, Broadleaf uses the FontAwesome set of icons out of the box, and it is intended that iconClass is an icon from the FontAwesome framework. To see the icons that are included, check out http://fortawesome.github.com/Font-Awesome/#icons-new- Parameters:
iconClass-
-
getDisplayText
-
setDisplayText
-
getActionUrlOverride
Gets the manual override for the data-actionurl attribute on an action.- Returns:
-
setActionUrlOverride
This is a manual override for the data-actionurl attribute for an listgrid action. The data-actionurl attribute on a button is normally automatically computed by appending the postfix URL to the path of the list grid- Parameters:
actionUrlOverride-
-
getActionId
Returns an Id that controllers can use to manipulate this action. For example, if a Controller wanted to not show the "Add" button that the system shows by default, they could remove the action with an id of "ADD".- Returns:
-
getAllCapable
- Returns:
- whether or not the given list grid action is capable of acting on rows even when none are selected
-
setAllCapable
Sets whether or not the given list grid action is capable of acting on rows even when none are selected- Parameters:
allCapable-
-
getSingleActionOnly
- Returns:
- whether or not this action can be performed only on a single item, regardless of whether the list grid is multi-select capable or not.
-
setSingleActionOnly
Sets where or not this action can only be performed on a single item. This is used to override multi-select list grids for certain actions.- Parameters:
singleActionOnly-
-
getActionTargetEntity
Returns a fully qualified ceiling entity that this listgrid action targets- Returns:
-
setActionTargetEntity
This is used to specify a target entityType for use in listgrid actions- Parameters:
actionTargetEntity-
-
getRequiresNonEmptyGrid
If a list grid action should be disabled unless there are one or more rows in the grid, this property should be true- Returns:
-
setRequiresNonEmptyGrid
-
getIsConfirmEnabled
-
setIsConfirmEnabled
-
getConfirmEnabledText
-
setConfirmEnabledText
-
clone
-