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

  • Home
  • SEARCH
  • 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 329117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:33:29+00:00 2026-05-12T09:33:29+00:00

What is the difference between the value and itemValue attribute of the radiobutton in

  • 0

What is the difference between the value and itemValue attribute of the radiobutton in Jsf?

  • 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-12T09:33:30+00:00Added an answer on May 12, 2026 at 9:33 am

    The value is meant to send in a SelectItem object and not a String like itemValue is. The itemValue is the items value, which is passed to the server as a request parameter, but the value is a value binding expression that points to a SelectItem instance.

    If you look at this JSF:

     <h:selectOneRadio value="">
        <f:selectItem itemValue="TestValue" itemLabel="TestLabel" />
    </h:selectOneRadio>
    

    which turns into this HTML:

    <table>
        <tr>
        <td>
            <input type="radio" name="j_id_id9" id="j_id_id9:0" value="TestValue" />
            <label for="j_id_id9:0"> TestLabel</label>
        </td>
        </tr>
    </table>
    

    So value = valueBinding pointing to a SelectItem in your managed bean, and itemValue = the value that is being submitted. If you decided to add a value=”#{TestBean.mySelectItem}” it would not change the outputted HTML in any way, but the JSF implementation would know that the getter property for the mySelectItem field should be used on this.

    Edit: To clarify the answer a bit more. The value property of the SelectItem binds the SelectItem to an SelectItem field in the managed bean via getter and setter properties. If you set the value like this:

     <h:selectOneRadio value="">
        <f:selectItem itemValue="TestValue" itemLabel="TestLabel" value="#{TestBean.mySelect}"/>
    </h:selectOneRadio>   
    

    it will invoke the getMySelectItem() method in the TestBean. As you can see this has nothing to do with the itemValue as the itemValue is resposible of setting the value of what goes in the request when the user submits the form. The itemValue will then be stored in the h:selectOneRadio’s value which hopefully you have bound up to a String field like this:

    <h:selectOneRadio value="#{TestBean.selectedRadioValue}">
    <f:selectItem itemValue="1" itemLabel="1. radio one" />
    <f:selectItem itemValue="2" itemLabel="2. radio two" />
    </h:selectOneRadio>
    

    Now if the user checks the radio which to him looks like: “1. radio one” the value “1” will be stored in the TestBean’s variable called selectedRadioValue

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

Sidebar

Related Questions

Just to make this clear - what is the difference between: String(value) and value
Is there a performance difference between i++ and ++i if the resulting value is
Difference between value parameter and reference parameter ? This question is asked sometime by
What is the difference between value = NULL; and value = ; in PHP
What is the difference between using andReturn(T value) vs andStubReturn(T value) for EasyMock? In
Greetings, I get the difference between pass by value and pass by reference. But
Is there any difference between null and System.DBNull.Value? If yes, what is it? I
What's the difference between an email Sender, From and Return-Path value? Example : I
Is there a difference between typeof value === undefined and value === undefined ?
Possible Duplicates: C++ cast syntax styles What is the difference between (type)value and type(value)

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.