liferay-management-toolbar-search-container

Implements bulk selection and bulk actions for Liferay clay:management-toolbar with liferay-ui:search-container JSPs.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/gweone/agent-plugins --skill liferay-management-toolbar-search-container-gweone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: liferay-management-toolbar-search-container
Source: https://github.com/gweone/agent-plugins/tree/main/plugin/sharpps-liferay/skills/liferay-management-toolbar-search-container
Command: npx skills add https://github.com/gweone/agent-plugins --skill liferay-management-toolbar-search-container-gweone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Liferay admin JSPs combining clay:management-toolbar with liferay-ui:search-container and RowChecker exhibit confusing bulk-selection bugs: "select all" only submits the current page's rows, checkboxes lack name attributes, and scripts run before the DOM exists. This Skill documents the verified architecture and correct patterns to make bulk actions work reliably. ## Core Features & Use Cases - Selection state via the AUI component: Read bulkSelection and subscribe to rowToggled through Liferay.componentReady(searchContainerId) instead of inspecting the DOM. - Server-side select-all resolution: Submit a selectAll flag plus filter criteria and recompute the matching row set in the action class, mirroring Liferay's own BulkSelectionFactory pattern. - propsTransformer wiring: Route actionDropdownItems clicks through onActionButtonClick in a propsTransformer, avoiding fragile DOM event delegation on React-rendered toolbar elements. - Use Case: A bulk delete on a 76-item list only deletes 20 rows because select-all checks only the current page; apply the hidden-flag plus server-recompute pattern so every matching item is deleted. ## Quick Start Fix my Liferay admin JSP so the management toolbar's select-all checkbox actually applies the bulk delete action to every matching row across all pages.

Frequently Asked Questions about liferay-management-toolbar-search-container

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does Liferay select all only select the current page?

The management toolbar's select-all checkbox is client-side React state with no name attribute; it only checks row checkboxes physically rendered on the current page. Submit a selectAll flag and recompute the full matching set server-side from the filter criteria.

How do I read selection state from a Liferay search container?

Use Liferay.componentReady(searchContainerId).then(sc => sc.select.get('bulkSelection')) to read select-all state, and subscribe to the rowToggled event for any selection change. Never inspect checkbox DOM attributes, since the header checkbox has no name or value.

How do I handle management toolbar action dropdown clicks in Liferay?

Wire a propsTransformer on the clay:management-toolbar tag and handle onActionButtonClick, matching item.data.action. This is the stock Liferay pattern and avoids unreliable DOM event delegation on React-rendered dropdown items.

Why does my aui:script not find elements in a Liferay JSP?

An aui:script block can execute before the surrounding server-rendered HTML exists in the DOM, so getElementById returns null. Look elements up inside Liferay.componentReady(...).then() or use event delegation on a stable ancestor.

Should clay:management-toolbar go inside or outside the aui:form?

Render the toolbar outside the aui:form. With showSearch enabled the toolbar renders its own nested form, and nesting forms produces invalid HTML that can detach row checkboxes from the outer form's submission.