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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:41:07+00:00 2026-06-01T05:41:07+00:00

I have a boolean(primitive) variable in my bean. I need its value to be

  • 0

I have a boolean(primitive) variable in my bean. I need its value to be true or false depending on the radio button selected by user.

I am implementing JSF radio buttons in two different columns of the same row of a jsf datatable.
It is a requirement that i use radio buttons in two columns of the same row.

Now, i have to make sure just one of the buttons id selected for a row.

So my approach is ,

i am using one radio button mapped to the bean and the other radio button as a dummy.

<h:column>
 <h:selectOneRadio id="mixtas" value="#{bean.mixtas}">
  <f:selectItem itemValue="true"></f:selectItem>
 </h:selectOneRadio>    
</h:column>

<h:column>
 <h:selectOneRadio id="exclusi" >
  <f:selectItem itemValue="true"></f:selectItem>
 </h:selectOneRadio>
</h:column>

And i am handling the select just one functionality using jquery

$('input[id*="mixtas"]').live("click",function(){
    var $index = this.id.split(':')[2]; \\to identify the row index
    var $id = $index+":exclusi:0"; \\generating id for other radio button
    $('table[id$="'+$id+'"]').attr("checked",false); \\ to make the other radio false   
});

$('input[id*="exclusi"]').live("click",function(){
    var $index = this.id.split(':')[2]; \\ to identify the row index
    var $id = $index+":mixtas:0"; \\generating id for other radio button
    $('input[id$="'+$id+'"]').attr("checked",false); \\ to make the other radio false   
});

The functionality works . Atleast half of it (i am still working on the rest).

But the issue is .

If i the mixtas radio button is unchecked and i try to proceed to another page.
It gives error “Property mixtas cannot be set to null“.

Is there any way to assign it a value false rather than null. Maybe in jquery or through bean.

Any suggestions please ….

Thanks In advance.

  • 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-06-01T05:41:09+00:00Added an answer on June 1, 2026 at 5:41 am

    From your previous questions I assume that you are using JSF 2.0. Then you could get the desired behavior without custom javascript:

    <h:column>
      <h:selectOneRadio value="#{bean.mixtas}" id="mixtas">
        <f:selectItem itemValue="true"/>
        <f:ajax render="exclusi"/>
      </h:selectOneRadio>
    </h:column>
    
    <h:column>
      <h:selectOneRadio value="#{bean.mixtas}" id="exclusi">
         <f:selectItem itemValue="false"/>
         <f:ajax render="mixtas"/>
      </h:selectOneRadio>
    </h:column>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have a situation where you need to know where a boolean value
I have a boolean method returning true or false to check whether or not
I have a boolean value set as a hidden variable in the form and
I have a boolean column in one of my tables (value is either 0
I have a boolean setting in my Properties/Settings.settings file, which basically stores per user
If I have a boolean field like: private static final boolean DEBUG = false;
I am creating an android application using Java. I have a boolean variable called
I have a boolean variable declared at the top of a class and when
Have a boolean field (using formtastic) and the value won't persist through an error.
I have a Boolean variable in Actionscript 3. How can I check if it's

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.