@PathVariable Map<String, String> pathVars,
@PathVariable(value = "id") String id) throws Exception {
String view = super.viewEntityForm(request, response, model, pathVars, id);
//Skus have a specific toolbar action to generate Skus based on permutations
EntityForm form = (EntityForm) model.asMap().get("entityForm");
ListGridAction generateSkusAction = new ListGridAction(ListGridAction.GEN_SKUS).withDisplayText("Generate_Skus")
.withIconClass("icon-fighter-jet")
.withButtonClass("generate-skus")
.withUrlPostfix("/generate-skus");
ListGrid skusGrid = form.findListGrid("additionalSkus");
if (skusGrid != null) {
skusGrid.addToolbarAction(generateSkusAction);
skusGrid.setCanFilterAndSort(false);
}
// When we're dealing with product bundles, we don't want to render the product options and additional skus
// list grids. Remove them from the form.
if (ProductBundle.class.isAssignableFrom(Class.forName(form.getEntityType()))) {
form.removeListGrid("additionalSkus");
form.removeListGrid("productOptions");
}
form.removeListGrid("defaultSku.skuAttributes");
return view;
}