Page 1 of 1

How to customize Admin 3.0 UI

Posted: Sun Jan 05, 2014 5:08 am
by pokemon007
I try to migrate 2.0-based admin to 3.0.6 (or 3.1.0). My 2.0 based admin UI was built with Thymeleaf instead of GWT that is aligned with the new Admin 3.0. However, I still need to customize the UI, i.e. adding fields, or adding completely different pages, etc. I don't see the doc that covers how to do these. Please point me to the document that covers this.

Thank you!

-Charlie

Re: How to customize Admin 3.0 UI

Posted: Tue Jan 07, 2014 3:56 pm
by phillipuniverse
We're behind on the documentation here. We're going to be enhancing a lot of our docs as apart of the 3.1 GA release that will occur this month.

A good starting point would be to look at AdminBasicEntityController which is the main controller for the admin now. We also have some specific subclasses that provide customizations in the framework (like AdminProductController) which might also be a good reference for the time being.

Re: How to customize Admin 3.0 UI

Posted: Tue Jan 07, 2014 3:56 pm
by phillipuniverse
By the way, we have a to-do list of what we are lacking as far as admin documentation goes here: https://github.com/BroadleafCommerce/docs/issues/8

Re: How to customize Admin 3.0 UI

Posted: Mon Feb 17, 2014 10:15 pm
by pokemon007
How do I reference the UI resources such as html templates, css, js that are located in broadleafcommerce jar?

Thanks.

-Charlie

Re: How to customize Admin 3.0 UI

Posted: Mon Mar 10, 2014 8:58 pm
by pokemon007
Any ETA on the documentation of Customization of Admin UI? The first version of the doc doesn't need to be perfect as long as can give us some direction. Most of the UI layout code seems intuitive, but some advanced parts are not. I need to understand a couple of specific items:

1) How to bring the UI of a editable contained list item to an entity add UI.
For instance, product options tab of product editing UI has additional skus group which allows user to add additional skus. What need is such UI group to be shown in add dialog. Is this possible? I'm creating Deal entity which is associated with a list of sku and no default sku.

2) Another thing is editing a singleton entity. I'm building a B2B commerce and need to allow merchant editing their account info. I've added it as a section under a module with url like /account. Clicking on it gives following error:

Code: Select all

[ERROR] 01:13:35 FormBuilderServiceImpl - There are no listgrid header fields configured for the class com.mycompany.admin.account.BusinessAccount Please mark some @AdminPresentation fields with 'prominent = true'


I didn't define any prominent property as I don't want to show this in grid view, but entity view. How do we skip the grid view and directly go to entity view?

Thank you very much!

-Charlie

Re: How to customize Admin 3.0 UI

Posted: Sat Mar 22, 2014 2:18 am
by pokemon007
I found a workaround, override controller's viewEntityList to redirect it to viewEntity with current merchant ID.

Thanks.

-Charlie

Re: How to customize Admin 3.0 UI

Posted: Sun Mar 23, 2014 8:01 pm
by phillipuniverse
By the way, based on what you originally described:

1) How to bring the UI of a editable contained list item to an entity add UI.
For instance, product options tab of product editing UI has additional skus group which allows user to add additional skus. What need is such UI group to be shown in add dialog. Is this possible? I'm creating Deal entity which is associated with a list of sku and no default sku.


That will be difficult as you have to be really careful about which one you add first. Meaning, there isn't any way to associate the Sku record that you are adding to the Product record because it hasn't been created yet. Not sure of what a possible workaround would be but that's the reason that you do not see any collection grids on any of the add screens but only on the edit screen.

The way to skip the entity view would be to simply navigate to a view with the id property (primary key) tacked onto the end of it. For instance, when you go to the list of products the URL is /admin/product but when you want to edit product with and id of 1 you go to /admin/product/1. Maybe there is some custom logic to just always redirect the user to their correct merchant account edit screen when they go to /admin/merchant or whatever.

Re: How to customize Admin 3.0 UI

Posted: Mon Mar 24, 2014 2:29 pm
by pokemon007
Thank you for the explanation. I was speculating this might be the issue as I've encountered it when I built my own admin UI through AJAX. The parent object must be created first. I used to use spring collection binding + client side script. It does allow client side adding/updating child objects and post to server along with all other data of parent object to be created. The maintenance is not pretty. So I gave up and switched to AJAX fashion.

Thank you!

-Charlie