jsfprimefaces

How to make p:menu scrollable in PrimeFaces?


I have a menu which I fill programmatically with a model. But I want it to become scrollable when its items become too many to be displayed in the page.

Here is my menu:

<p:menu overlay="true" trigger="imgNotif" my="left top"
        at="bottom left" model="#{notifController.model}" />

Is there a way to make it scrollable (programmatically or using its style/attributes)?


Solution

  • Use the following CSS:

    .ui-menu {
      overflow-y: scroll;      
      height: 200px;      
    }