Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4085700
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:37:01+00:00 2026-05-20T18:37:01+00:00

i have a selectOneMenu with selectitems. if i use <f:selectItem itemValue=3 itemLabel=#{hrBundle[‘phoneType3’]}/> it works

  • 0

i have a selectOneMenu with selectitems.
if i use

<f:selectItem itemValue="3" itemLabel="#{hrBundle['phoneType3']}"/>

it works well, displaying the localized label. i have more options inside a List and when i use f:selectItems, it stops working.
this code:

<f:selectItems value="#{values}" var="item" itemLabel="#{hrBundle[item.label]}" itemValue="item.value"/>

shows the key(‘phoneType3’) as label, and even

<f:selectItems value="#{values}" var="item" itemLabel="#{hrBundle['phoneType3']}" itemValue="item.value"/>

(‘hardcoded’ as the single f:selectItem above) displays the key (‘phoneType3’) instead of the localized label.

any idea what i am doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:37:02+00:00Added an answer on May 20, 2026 at 6:37 pm

    It depends on what the key in your bundle file is. If the key in your bundle ist the content of item.value, do the following:

    <f:selectItems value="#{myBean.values}" 
     var="item" 
     itemLabel="#{hrBundle[item.value]}" 
     itemValue="#{item.value}"/>
    

    I don’t know, if this is your original code. If yes, notice the following:

    1. You have to reference a backing bean
      in your value attribute (as shown
      above: replace myBean with your
      beans name).
    2. The itemValue attribute needs an
      el expression as well: itemValue=
      "#{item.value}"
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this menu: <h:selectOneMenu value=#{ApplicationController.settings['SessionTTL']}> <f:selectItem itemValue=60 itemLabel=1 hour /> <f:selectItem itemValue=30 itemLabel=30
I have this SelectOneMenu: <h:selectOneMenu value=#{orderController.requestVO.requestSituation}> <f:converter converterId=ComboConverter/> <f:selectItems value=#{orderController.requestSituation} var=requestSituation itemLabel=#{requestSituation.description} itemValue=#{requestSituation} />
I have the following JSF 2 code: <p:selectOneMenu id=dropdown value=#{data.selection} required=true converter=selectOneMenuConverter> <f:selectItem itemLabel=Select
Hi I have the follonwing selectOneMenu <h:selectOneMenu value=#{modelsController.selected.idBrands}> <f:selectItems value={brandsController.itemsAvailableSelectOne} /> </h:selectOneMenu> <br/> which
I have a h:selectOneMenu thats filled with enum values, which works fine. The only
I have problems with SelectOneMenu. I write this: <h:selectOneMenu id=listaEstados styleClass=comboboxStyle value=#{detalleSistemaBean.sistema.indEstado} immediate=true> <f:selectItems
I have a selectOneMenu that displays some different stuff categories: <h:selectOneMenu value=#{searchController.selectedCategory}> <f:selectItems value=#{searchController.formatedCategories()}
I have this <p:selectOneMenu id=dec value=#{editCommandController.myCom.decision} > <f:selectItems value=#{editCommandController.decisions} /> <p:ajax update=etat :myform:alors event=change
I have a <h:selectOneMenu> that has <f:selectItems> with CategoryHistory objects loaded in it. I
<h:selectOneMenu id=filtroUnidad immediate=true style=width:120px value=#{class.idUni} label=#{bundleComunes.unidad}> <f:selectItem itemLabel=#{bundleComunes.seleccionar}... itemValue=/> <f:selectItems value=#{class.lUnidadesValidas} var=lUni itemValue=#{lUni.id} itemLabel=#{lUni.descripcion}/>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.