I wanted to avoid the traditional design approach for managing Roles in the NixMash Spring Administration module. By “traditional design” I’m referring to a Roles List Page with a separate Role Edit page and possibly a third page to Add a Role. Since we’re only talking about a single property for now, Role Name, there was no reason we couldn’t use a single page for everything.
First the screen displays, starting with the Roles List.
Here’s the Dandelion Datatable Thymeleaf HTML with the hidden form. We initially hide the form column with a simple dt:visible=”false” property.
We added a separate non-Dandelion table on the page which is initially hidden. When we want to add a Role, this table is displayed and the Dandelion Datatable is hidden.
You can see how we make columns visible and hidden in the #editRoles onClick() function. One other point to make is that to hide a Dandelion Datatable we don’t hide its Table Element but rather the wrapper it creates around the table and its decorative items like paging controls and search boxes.