Skip to content

Dynamic contextMenu not working if MenuModel empty by default #13465

@mnyakushev

Description

@mnyakushev

Describe the bug

I have dataData with contextMenu. The content of the context menu depends on the selected row in the table. If an empty model is passed as the value in contextMenu during the initial rendering of the table, the menu will never be displayed. However, if a model with at least one element is passed, the context menu works as expected.

On 14.0.12 I see empty menu when I right-click on third and fourth rows, but menu appears.

Reproducer

https://github.com/mnyakushev/primefaces-test/tree/contextMenu15

Expected behavior

The context menu appears when I right-click on a table row, even though the menu model is empty when the table is initially displayed.

PrimeFaces edition

None

PrimeFaces version

15.0.0

Theme

No response

JSF implementation

Mojarra

JSF version

4.0.9

Java version

21

Browser(s)

No response

Metadata

Metadata

Assignees

Labels

🐞 defectBug...Something isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions