0

I want to change the width of my picklist instead of having the default width in primefaces.css I have tried this but it doesn't work.

<h:body>
    <f:facet name="last">
        <h:outputStylesheet library="default" name="mystyle.css" />
    </f:facet>
    <p:pickList ...>
       ...
    </p:picklist>
</h:body>

And in my mystyle.css I've only this:

.ui-picklist .ui-picklist-list{
    width:400px !important;
}
Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40
junior developper
  • 448
  • 2
  • 19
  • 40

1 Answers1

1

Your CSS is apparently never being loaded. If you have checked the generated HTML output and/or the HTTP traffic monitor, you should have noticed it. The culprit is the <f:facet name="last"> which isn't supported by <h:body>. It's only supported by <h:head> and even then only when PrimeFaces is installed.

This should do:

<h:body>
    <h:outputStylesheet library="default" name="mystyle.css" />

    <p:pickList ...>
       ...
    </p:pickList>
</h:body>

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555