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 4066840
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:10:35+00:00 2026-05-20T16:10:35+00:00

I have a selectOneRadio menu with some selectItem’s in them. I want to show

  • 0

I have a selectOneRadio menu with some selectItem’s in them. I want to show the choices based on a property file. For example, if a store doesn’t have a credit card reader, then I wouldn’t show the credit option. There should be a config/properties file specifiying what is shown and what is not.

Is there a way to accomplish that? I assume I need to read the properties file into the backing bean and then have something like a ‘rendered’ attribute. However, I just tried and ‘rendered’ doesn’t seem to work for selectItem.

<h:selectOneRadio id="selectedPaymentMethod" layout="pageDirection" 
        value="#{selectPaymentMethodAction.selectedPaymentMethod}">

    <f:selectItem itemValue="online" itemLabel="#{paymentMsg['payment.online.lbl']}"/>
    <f:selectItem itemValue="cash" itemLabel="#{paymentMsg['payment.cash.lbl']}"/>
    <f:selectItem itemValue="credit" itemLabel="#{paymentMsg['payment.credit.lbl']}"/>
    <f:selectItem itemValue="debit" itemLabel="#{paymentMsg['payment.debit.lbl']}"/>

</h:selectOneRadio>
  • 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-20T16:10:36+00:00Added an answer on May 20, 2026 at 4:10 pm

    Use <f:selectItems> which you feed with a List<SelectItem> based on the bundle file. This way you can control using usual Java code whether the item should be added or not.

    E.g.

    <f:selectItems value="#{selectPaymentMethodAction.paymentMethods}" />
    

    with

    private List<SelectItem> paymentMethods; // +getter
    
    public Bean() {
        paymentMethods = new ArrayList<SelectItem>();
        ResourceBundle bundle = ResourceBundle.getBundle("com.example.Messages", FacesContext.getCurrentInstance().getViewRoot().getLocale());
    
        if (condition) {
            paymentMethods.add(new SelectItem("online", bundle.getString("payment.online.lbl")));
        }
    
        // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some trouble with using h:selectOneRadio . I have a list of
JSF 2.0, Primefaces 3.1.1 I have two p:selectOneRadio components: <p:selectOneRadio id=radio1 value=#{inningBean.lastDeliveryType}> <f:selectItem itemLabel=Wide
I have the following JSF 2.1 page <h:selectOneRadio value=#{userBean.newUser}> <f:selectItem itemValue=0 itemLabel=new User />
In JSF 2.0 I have below <h:selectOneRadio value=#{StageGate.sketchesSG002006Decision} onclick=validateMyRadioButton() id=radio26> <f:selectItem itemValue=Accepted itemLabel=Accepted id=accepted/>
I want to do some crazy grouping with SelectOneRadio, so I decide to create
I have the following h:selectOneRadio : <h:selectOneRadio id=#{prefix}_rating value=#{examinationPanel.tempResult} > <f:selectItems value=#{examinationPanel.options}></f:selectItems> </h:selectOneRadio> And
I have a scenario like the below.. <h:selectOneRadio id=someId value=#{myBean.type} required=true> <f:ajax event=valueChange execute=@form
Have deployed numerous report parts which reference the same view however one of them
i have the following in my page. <h:selectOneRadio layout=pageDirection > <s:selectItems value=#{usageList} var=entry label=#{labels[entry.label]}
I have a radiobutton list and would like to disable some items according to

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.