1
.ui-orderlist .ui-orderlist-list {
    height: auto;
}

Should't it set height of list to auto? Because it does't work. In browser styles appears like

.ui-orderlist .ui-orderlist-list {
    list-style-type: none;
    margin: 0px;
    padding: 0px;
    overflow: auto;
    height: 200px;
    width: 200px;
}
.ui-orderlist .ui-orderlist-list {
    height: auto; // this line no active
}
LarsBauer
  • 1,539
  • 18
  • 23
  • You could give it a styleClass property and fix it in the CSS file. Is also better for maintenance – W vd L May 18 '15 at 12:26
  • no mater how to define it –  May 18 '15 at 12:27
  • 1
    but that makes it an CSS issue, not a JSF issue ;-) – W vd L May 18 '15 at 12:27
  • 1
    I'm not a CSS guru, adding !important ( height: auto !important; ) should make the css line always active. Better solution is to have a correct order of CSS files loading in the header. – W vd L May 18 '15 at 12:47
  • @WvdL well, it works. the header contains only custom styles. –  May 18 '15 at 12:55

2 Answers2

0

You can override css rules by making them more specific than default primefaces rules and thus giving more "weight" for your custom rule. For example, wrap your order list with a < div class="some_class">< p:orderList ... />< /div> and provide css rule like:

div.some_class .ui-orderlist .ui-orderlist-list {
    height: auto;
}

You can read more about css specificity here and here.

Alternatively you could add an !important exception to your custom rule like:

.ui-orderlist .ui-orderlist-list {
    height: auto !important;
}

Such approach though is not recommended and should be used (as mentioned @Kukeltje in comment) as the last choice.

olexd
  • 1,360
  • 3
  • 13
  • 26
-1

I had the same issue some days ago. You have to make sure that your stylesheet gets loaded after default PrimeFaces CSS. You can achieve this by including your stylesheet in the following way:

<h:head>
    <f:facet name="last">
        <link type="text/css" rel="stylesheet" href="/css/yourstyle.css"></link>
    </f:facet>
</h:head>

PS: Please do not use !important.

LarsBauer
  • 1,539
  • 18
  • 23