4

I have been struggling to make adjustments in the fonts size and adjustment i the selectOneMenu, but i have come to peace with it, however after upgrading PrimeFaces from 3.2 to 3.4.2, the selectOneMenu has a gap prefixed to it, which is very annoying.

PrimeFaces 3.2 selectOneMenu

PrimeFaces 3.2 selectOneMenu

PrimeFaces 3.4.2 selectOneMenu

PrimeFaces 3.4.2 selectOneMenu

Code

<p:selectOneMenu id="Category" value="#{databaseSearch.category}" style=" font-size: 35px; height: 20px; width: 80px;">

                                        <f:selectItem itemLabel="Machine" itemValue="Machine"/>
                                        <f:selectItem itemLabel="Company" itemValue="Company"/>
                                        <f:selectItem itemLabel="Contact" itemValue="Contact"/>
                                        <f:selectItem itemLabel="Phone" itemValue="Phone"/>
                                        <f:selectItem itemLabel="Email" itemValue="Email"/>

                                    </p:selectOneMenu>

What do i do ? :(

4

2 回答 2

10

您需要覆盖此css .ui-selectonemenu .ui-selectonemenu-label

于 2013-08-02T09:05:04.393 回答
0

正确的方法是添加一个新类而不更改框架的默认值。

我有同样的问题,但在我的情况下,selectOneMenu用于应用程序的其他部分,因此我无法编辑它。

我像这样在我的standardStyle.css中创建了一个新类

.fullWidth {
    min-width: 100% !important;
}

然后在 selectOneMenu 添加我的类如下

<p:selectOneMenu id="idOfSOM" value="#{mybean.value}" styleClass="fullWidth"></p:selectOneMenu>
于 2018-11-23T14:21:34.530 回答