How do I show IDs in the admin's listgrids?

Displaying the entity IDs is driven by the listGrid.forceShowIdColumns property. Broadleaf auto hides them all by default since for the most part, the broadleaf ID tends to not matter to most users. However, this can be enabled by setting the property to `true` to show them. Just note that this affects ALL list grids. This works off of the following code:


That code is used in listGrid.html:

The code above can also be triggered via a request parameter. If you add ?showIds=true to the end of your request it should display them. For example:

If you need to be more specific and ONLY show the IDs on one section (i.e. just show the IDs on the products) you can do so by extending the corresponding AdminController. In this example you can the AdminProductController and override the viewEntityList method.

    public String viewEntityList(HttpServletRequest request, HttpServletResponse response, Model model, Map<String, String> pathVars, MultiValueMap<String, String> requestParams) throws Exception {
        String result = super.viewEntityList(request, response, model, pathVars, requestParams);
        ListGrid listGrid = (ListGrid) model.asMap().get("listGrid");
        return result;