Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 268
ehab refaat Avatar asked May 28 '13 05:05

ehab refaat


2 Answers

My solution: autoWidth="false"

like image 180
Marcos Abrahão Avatar answered Nov 05 '22 07:11

Marcos Abrahão


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

.ui-selectonemenu{
     width: 100% !important;
}
.ui-selectonemenu-label{
     width: 100% !important;
}  
like image 42
ehab refaat Avatar answered Nov 05 '22 05:11

ehab refaat