Add button not showing in Clay management-toolbar

Jamie Sammons, modified 3 Years ago. New Member Post: 1 Join Date: 8/16/22 Recent Posts

I'm following the "DXP 7.2 back-end developer" course and I've copied the exact same code in the exercise, however I'm not getting the same result.

view.jsp:

<clay:management-toolbar
    disabled="${assignmentCount eq 0}"
    displayContext="${AssignmentsManagementToolbarDisplayContext}"
    itemsTotal="${assignmentCount}"
    searchContainerId="assignmentEntries"
    selectable="false"
/>

com.liferay.training.gradebook.web.display.context.AssignmentsManagementToolbarDisplayContext.java:

...
public class AssignmentsManagementToolbarDisplayContext extends BaseManagementToolbarDisplayContext {
...
 public CreationMenu getCreationMenu() {

	// Create the menu.

	return new CreationMenu() {
	    {
		addDropdownItem(dropdownItem -> {
		    dropdownItem.setHref(liferayPortletResponse.createRenderURL(), "mvcRenderCommandName",
			    MVCCommandNames.EDIT_ASSIGNMENT, "redirect", currentURLObj.toString());
		    dropdownItem.setLabel(LanguageUtil.get(request, "add-assignment"));
		});
	    }
	};
}
...

All copied from the exercises in the course. There were no errors in the console.

Result:

Expected result:

Any help would be appreciated.

thumbnail
Russell Bohl, modified 3 Years ago. Expert Posts: 308 Join Date: 2/13/13 Recent Posts

Hi Khaleel, I don't know much about this course, or about Clay, but it might help if you specify exactly which exercise you downloaded so someone can take a look at it.

Also, your Result and Expected Result are blank. Did yopu mean to post screenshots?

thumbnail
Jamie Sammons, modified 3 Years ago. New Member Posts: 18 Join Date: 8/3/22 Recent Posts

Hi all,

Some additions:

We are talking about the 03-application-presentation course, where we add the <clay:management-toolbar> in page 14.

 

I had the same issue few weeks ago, at some point it solved itself suddenly. Because I didnt understand why, I created another project but this time It did not magically resolve, nor could I resolve it. No idea until now. I gave up, beacuse:

The ManagementToolbar is declared as deprecated, and its not the only thing used in the tutorials. (Management Toolbar - Clay (clayui.com))

I think someone needs to update these tutorials.