ehab refaat ehab refaat - 3 months ago 323
CSS Question

PrimeFaces p:selectOneMenu width

I want

p:selectOneMenu
width to be auto regarding to the parent cell not regarding to the values it has.

<p:panelGrid>
<p:row>
<p:column><p:outputLabel value="Value01" for="idInput01"/></p:column>
<p:column><p:inputText value="#{bean.input01}" id="idInput01" /></p:column>
<p:column><p:outputLabel value="Value02" for="idSelect" /></p:column>
<p:column>
<p:selectOneMenu value="#{bean.selectedObject}" id="idSelect" converter="objectConverter">
<f:selectItems value="#{bean.objectsList}" var="varObject" itemLabel="#{varObject.label}" itemValue="#{varObject}" />
</p:selectOneMenu>
</p:column>
</p:row>
</p:panelGrid>


What I've got :

enter image description here

What I'm expecting :

enter image description here

Note: I don't want to specify a fixed width.

Answer

i overrode .ui-selectonemenu, .ui-selectonemenu-label to:

.ui-selectonemenu{
     width: 100% !important;
}
.ui-selectonemenu-label{
     width: 100% !important;
}  
Comments