Locale

Language
English
English
English
French
German
German
Italian
Korean
Spanish
Catalan
Dutch
Portuguese
Portuguese
Arabic
Arabic
Bulgarian
Czech
Greek
Persian
Finnish
Danish
Hindi
Indonesian
Croatian
Japanese
Hungarian
Hebrew
Georgian
Central Kurdish
Khmer
Kyrgyz
Kazakh
Lithuanian
Latvian
Malay
Norwegian
Polish
Romanian
Russian
Slovak
Slovenian
Serbian
Swedish
Thai
Turkish
Ukrainian
Vietnamese
Chinese
Chinese

Input Style

Free Themes

Built-in component themes created by the PrimeFaces Theme Designer.

Saga Saga
Vela Vela
Arya Arya

Legacy Free Themes

Luna Amber Luna Amber
Luna Blue Luna Blue
Luna Green Luna Green
Luna Pink Luna Pink
Nova Nova
Nova Nova Alt
Nova Nova Accent

SelectOneMenu

SelectOneMenu is used to choose a single item from a list.

Name
Afghanistan
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua & Barbuda
Argentina
Armenia
Aruba
Australia
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bosnia & Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
British Virgin Islands
Brunei
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Caribbean Netherlands
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo - Brazzaville
Congo - Kinshasa
Cook Islands
Costa Rica
Croatia
Cuba
Curaçao
Cyprus
Czechia
Côte d’Ivoire
Denmark
Djibouti
Dominica
Dominican Republic
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Eswatini
Ethiopia
Falkland Islands
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard & McDonald Islands
Honduras
Hong Kong SAR China
Hungary
Iceland
India
Indonesia
Iran
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Kuwait
Kyrgyzstan
Laos
Latvia
Lebanon
Lesotho
Liberia
Libya
Liechtenstein
Lithuania
Luxembourg
Macao SAR China
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia
Moldova
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar (Burma)
Namibia
Nauru
Nepal
Netherlands
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Korea
North Macedonia
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestinian Territories
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn Islands
Poland
Portugal
Puerto Rico
Qatar
Romania
Russia
Rwanda
Réunion
Samoa
San Marino
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Singapore
Sint Maarten
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Georgia & South Sandwich Islands
South Korea
South Sudan
Spain
Sri Lanka
St. Barthélemy
St. Helena
St. Kitts & Nevis
St. Lucia
St. Martin
St. Pierre & Miquelon
St. Vincent & Grenadines
Sudan
Suriname
Svalbard & Jan Mayen
Sweden
Switzerland
Syria
São Tomé & Príncipe
Taiwan
Tajikistan
Tanzania
Thailand
Timor-Leste
Togo
Tokelau
Tonga
Trinidad & Tobago
Tunisia
Turkmenistan
Turks & Caicos Islands
Tuvalu
Türkiye
U.S. Outlying Islands
U.S. Virgin Islands
Uganda
Ukraine
United Arab Emirates
United Kingdom
United States
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Vietnam
Wallis & Futuna
Western Sahara
Yemen
Zambia
Zimbabwe
Åland Islands
flag
wallet
map
link

<div class="card">
    <h:form>
        <div class="ui-fluid formgrid grid">
            <div class="field col-12 md:col-4">
                <p:outputLabel for="@next" value="Basic"/>
                <p:selectOneMenu id="option" value="#{selectOneMenuView.selectedOption}">
                    <f:selectItem itemLabel="Select One" itemValue=""/>
                    <f:selectItem itemLabel="Option1" itemValue="Option1"/>
                    <f:selectItem itemLabel="Option2" itemValue="Option2"/>
                    <f:selectItem itemLabel="Option3" itemValue="Option3"/>
                    <f:facet name="footer">
                        <p:divider styleClass="mt-0" />
                        <h:outputText value="3 options" style="font-weight:bold;"/>
                    </f:facet>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel for="@next" value="Grouping"/>
                <p:selectOneMenu id="group" value="#{selectOneMenuView.countryGroup}">
                    <f:selectItem itemLabel="Select One" itemValue=""/>
                    <f:selectItems value="#{selectOneMenuView.countriesGroup}"/>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel for="@next" value="Editable"/>
                <p:selectOneMenu id="city" value="#{selectOneMenuView.city}" editable="true">
                    <f:selectItem itemLabel="Select One" itemValue=""/>
                    <f:selectItems value="#{selectOneMenuView.cities}"/>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel value="Label"/>
                <p:selectOneMenu id="labeled" value="#{selectOneMenuView.labeled}" label="Always Display Label"
                                alwaysDisplayLabel="true">
                    <f:selectItems value="#{selectOneMenuView.cities}"/>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel for="@next" value="Advanced"/>
                <p:selectOneMenu id="advanced" value="#{selectOneMenuView.country}" converter="#{countryConverter}"
                                panelStyle="width:180px" var="c"
                                filter="true" filterMatchMode="startsWith" filterNormalize="true">

                    <f:selectItems value="#{selectOneMenuView.countries}" var="country"
                                itemLabel="#{country.name}" itemValue="#{country}"/>

                    <p:column style="width:10%">
                        <span class="flag flag-#{c.code}" style="width: 30px; height: 20px"/>
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Name"/>
                        </f:facet>
                        <h:outputText value="#{c.name}"/>
                    </p:column>

                    <f:facet name="footer">
                        <h:outputText value="XX countries"
                                    style="font-weight:bold;" styleClass="py-1 block"/>
                    </f:facet>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel for="@next" value="Lazy"/>
                <p:selectOneMenu id="lazy" value="#{selectOneMenuView.option}" dynamic="true">
                    <f:selectItem itemLabel="Select One" itemValue=""/>
                    <f:selectItems value="#{selectOneMenuView.options}"/>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel for="@next" value="Hide NoSelection Option"/>
                <p:selectOneMenu id="hideNoselectionOption" value="#{selectOneMenuView.hideNoSelectOption}"
                                hideNoSelectionOption="#{not empty selectOneMenuView.hideNoSelectOption}">
                    <p:ajax update="@this" process="@this"/>
                    <f:selectItem itemLabel="Select One" itemValue="#{null}" noSelectionOption="true"/>
                    <f:selectItem itemLabel="Option1" itemValue="Option1"/>
                    <f:selectItem itemLabel="Option2" itemValue="Option2"/>
                    <f:selectItem itemLabel="Option3" itemValue="Option3"/>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel for="@next" value="Long Item Label"/>
                <p:selectOneMenu id="longItemLabel" value="#{selectOneMenuView.longItemLabel}">
                    <f:selectItem itemLabel="Zero" itemValue="0"/>
                    <f:selectItem itemLabel="One" itemValue="1"/>
                    <f:selectItem itemLabel="Two" itemValue="2"/>
                    <f:selectItem itemLabel="Three" itemValue="3"/>
                    <f:selectItem itemLabel="Four" itemValue="4"/>
                    <f:selectItem itemLabel="Five" itemValue="5"/>
                    <f:selectItem itemLabel="Six" itemValue="6"/>
                    <f:selectItem itemLabel="Seven" itemValue="7"/>
                    <f:selectItem itemLabel="Long item here not necessary in the end" itemValue="99"/>
                    <f:selectItem itemLabel="Eight" itemValue="8"/>
                    <f:selectItem itemLabel="Nine" itemValue="9"/>
                    <f:selectItem itemLabel="Ten and not more than ten " itemValue="10"/>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel for="@next" value="RTL"/>
                <p:selectOneMenu id="trl" value="#{selectOneMenuView.rtl}" dir="rtl">
                    <f:selectItem itemLabel="Select One" itemValue=""/>
                    <f:selectItem itemLabel="Option1" itemValue="Option1"/>
                    <f:selectItem itemLabel="Option2" itemValue="Option2"/>
                    <f:selectItem itemLabel="Option3" itemValue="Option3"/>
                </p:selectOneMenu>
            </div>

            <div class="field col-12 md:col-4">
                <p:outputLabel for="selectOneMenuIcon" value="Icons" />
                <h:panelGroup styleClass="ui-inputgroup">
                    <h:panelGroup id="icon" styleClass="ui-inputgroup-addon">
                        <i class="pi pi-#{selectOneMenuView.icon}"/>
                    </h:panelGroup>
                    <p:selectOneMenu id="selectOneMenuIcon" value="#{selectOneMenuView.icon}" var="item">
                        <f:selectItems value="#{['flag','wallet','map','link']}" var="item" itemLabel="#{item}"
                            itemValue="#{item}" />
                        <p:column><i class="pi pi-#{item}" /> #{item} </p:column>

                        <p:ajax update="@parent:@parent:icon" />
                    </p:selectOneMenu>
                </h:panelGroup>
            </div>
        </div>
    </h:form>
</div>