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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:06:40+00:00 2026-05-15T02:06:40+00:00

I am having some trouble with using h:selectOneRadio . I have a list of

  • 0

I am having some trouble with using h:selectOneRadio. I have a list of objects which is being returned which needs to be displayed. I am trying something like this:

<h:selectOneRadio id="selectPlan" layout="pageDirection">
    <f:selectItems value="#{detailsHandler.planList}" />
</h:selectOneRadio>

and planList is a List of Plans. Plan is defined as:

public class Plan {
    protected String id;
    protected String partNumber;
    protected String shortName;
    protected String price;
    protected boolean isService;
    protected boolean isOption;  
    //With all getters/setters
}

The text that must appear for each radio button is actually in a properties file, and I need to insert params in the text to fill out some value in the bean. For example the text in my properties file is:

plan_price=The price of this plan is {0}.

I was hoping to do something like this:

<f:selectItems value="<h:outputFormat value="#{i18n.plan_price}">
    <f:param value="#{planHandler.price}">
</h:outputFormat>" />

Usually if it’s not a h:selectOneRadio component, if it’s just text I use the h:outputFormat along with f:param tags to display the messages in my .property file called i18n above, and insert a param which is in the backing bean. here this does not work. Does anyone have any ideas how I can deal with this?

I am being returned a list of Plans each with their own prices and the text to be displayed is held in property file. Any help much appreciated.

Thanks!


I am now able to resolve the above issue following the recommendation below. But now I have another question.
Each radio button item must display like this:

Click **here**  to see what is included. The cost is XX.

Now the above is what is displayed for each radio button. The “here” needs to be a hyperlink which the user can click and should bring up a dialog box with more info.I can display the sentence above but how do I make the “here” clickable?

Since the above is what is displayed it is the label for SelectItem(Object value, String label) which is returned.

Any ideas much appreciated.

  • 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-15T02:06:41+00:00Added an answer on May 15, 2026 at 2:06 am

    The value passed to <f:selectItems /> must be a list or array of type javax.faces.model.SelectItem.

    You can set the output label in the constructor of the SelectItem. I imagine you can access your properties file from the backing bean. The method to get the SelectItems would look something like this:

    public List<SelectItem> getPlanItems() {
      List<SelectItem> list = new ArrayList<SelectItem>();
      for (Plan plan : planList) {
        String label = buildPlanPriceLabel(plan.getPrice());
        list.add(new SelectItem(plan, label));
      }
      return list;
    }
    

    Leaving buildPlanPriceLabel as an exercise for the reader.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I am having some trouble trying to checkout the BitSharp source code using SVN.
I'm having some trouble using sessions with php.. I think I have figured out
I'm having some trouble using the std container classes (list, map etc.) in C++.
I'm having some trouble using mySQL and Spring JDBCTemplate. I have an INSERT ...
I am having some trouble using the GTK Expander widget. I have several expanders
I'm having some trouble printing out the contents of a linked list. I'm using
I have been having some trouble using RapidXML to parse a string. I receive
I'm having some trouble using the jQuery BlockUI plugin. What I'm trying to do
i'm trying to create a flow layout and i'm having some trouble using float:left

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.