문제

In my facelet, I have one selectOneMenu where I want to apply filter. Filter is working as expected. The only problem is that the width of the filter is not matching the parent.

Below is what I did in my facelet:

<p:selectOneMenu id="state" filter="true"
    filterMatchMode="startsWith" 
    value="#{manageEmployeeInfoBean.selectedState}">
        <f:selectItem itemLabel="Select One" itemValue=""
             noSelectionOption="true" />
        <f:selectItems
             value="#{manageEmployeeInfoBean.availableStates}"
             var="aState" itemLabel="#{aState}"
             itemValue="#{aState}" />
</p:selectOneMenu>

Here is the screenshot:

screenshot

As you can see, it looks very odd. How to set the width of the filter as per the parent one?

도움이 되었습니까?

해결책

Add this in your css file

.ui-selectonemenu-filter-container {
    width: 98% !important;
}

or 100% if you don't want any padding

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top