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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:09:32+00:00 2026-06-11T17:09:32+00:00

Im using the h:selectOneRadio and having issues when I try to change the default

  • 0

Im using the h:selectOneRadio and having issues when I try to change the default radio selection. Below is the JSF code

<h:selectOneRadio id="radioSelectID1" layout="pageDirection" value="#{scheduleBean.selectedRecurrenceValue}"   immediate="true" >
                                        <f:selectItem id="dailyID" itemLabel="#{adminBean.adminScreenLabelVO.dailyLabel}" itemValue="#{scheduleBean.dailyValue}"></f:selectItem>
                                        <f:selectItem id="weeklyID" itemLabel="#{adminBean.adminScreenLabelVO.weeklyLabel}" itemValue="#{scheduleBean.weeklyValue}"></f:selectItem>
                                        <f:selectItem id="monthlyID" itemLabel="#{adminBean.adminScreenLabelVO.monthlyLabel}" itemValue="#{scheduleBean.monthlyValue}"></f:selectItem>
                                        <f:ajax event="change" listener="#{scheduleBean.recurrenceChange}" render="recurrencePanelID" />
                                    </h:selectOneRadio>

below is the backingbean code for the selectedRecurrenceValue

public String getSelectedRecurrenceValue() {

    if(selectedRecurrenceValue == null)
    {
        selectedRecurrenceValue = adminScheduledetailsVO.getFrequency();
        if(selectedRecurrenceValue.equalsIgnoreCase(dailyValue))
        {
            dailyPanelRenderer = true ;
        }
        if(selectedRecurrenceValue.equalsIgnoreCase(weeklyValue))
        {
            dailyPanelRenderer = false ;
            weeklyPanelRenderer = true ;
        }

        if(selectedRecurrenceValue.equalsIgnoreCase(monthlyValue))
        {
            monthlyPanelRenderer = true ;
        }
    }

    return selectedRecurrenceValue;
}

The issue occurs when I try to change the radioselection option. Im unable to initialize the value selectedRecurrenceValue, since Im getting it dynamically. When I try to select another radio button, Im receiving a null pointer exception for selectedRecurrenceValue.
Any pointers to fix the issue would be really helpful.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-11T17:09:33+00:00Added an answer on June 11, 2026 at 5:09 pm

    If I read your question right it seems that you don’t need the field selectedRecurrenceValue and should bind adminScheduledetailsVO.frequency directly to your selectOneRadio:

    <h:selectOneRadio id="radioSelectID1" 
                      layout="pageDirection" 
                      value="#{scheduleBean.adminScheduledetailsVO.frequency}" >
    

    Then of course adminScheduledetailsVO needs to be initialized before to avoid the NPE.

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

Sidebar

Related Questions

With the code below, i'm using a listener on the selectOneRadio to redirect to
I am having some trouble with using h:selectOneRadio . I have a list of
i have the following in my page. <h:selectOneRadio layout=pageDirection > <s:selectItems value=#{usageList} var=entry label=#{labels[entry.label]}
I'm having trouble using a selectOneRadio component. I get a NullPointerException in my Converter's
using Silverlight I am having trouble with the following code: CultureInfo culture = new
How do you get which radio is selected within p:selectOneRadio using javascript/jquery ? Since
How to detect which radio button was clicked in h:selectOneRadio using javascript or maybe
How to get layout like the following using h:selectOneRadio encapsulated within a rich:dataTable row1
I'm using primefaces layout component and having difficulty with a component in an embedded
I am actually using h:selectOneRadio to display items, given to it from f:selectItems tag.

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.