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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:09:04+00:00 2026-06-06T10:09:04+00:00

I have a scenario like the below.. <h:selectOneRadio id=someId value=#{myBean.type} required=true> <f:ajax event=valueChange execute=@form

  • 0

I have a scenario like the below..

<h:selectOneRadio id="someId" value="#{myBean.type}" required="true">                               
    <f:ajax  event="valueChange"  execute="@form" render="myPanel">
    <f:selectItem itemLabel="Existing Type" itemValue="Existing Type" />
    <f:selectItem itemLabel="New Type" itemValue="New Type" />
<h:selectOneRadio>

<h:panelGroup id="myPanel" rendered="#{myBean.checkforNewType()}">
    <h:inputText id="txtval" value="#{mybean.val}" required = "true" requiredMessage="Some message">
    <h:message for="txtval" styleClass="error"/>
<h:panelGroup>

Basically the panel containing the textbox should be hidden if the value of the property type is “Existing Type”.
But the issue I am facing is if user leave the box blank the panel is not hidden as it fails the validation.

Is there anyway to avoid the validation when the panel containing the textbox is being hidden?

  • 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-06T10:09:06+00:00Added an answer on June 6, 2026 at 10:09 am

    Better check the request parameter value instead. The model value is namely not updated when the validation has failed in general and thus your rendered condition will fail when being bound to a request scoped bean.

    <h:selectOneRadio id="someId" value="#{myBean.type}" required="true">                               
        <f:ajax event="valueChange" execute="@form" render="myPanel">
        <f:selectItem itemLabel="Existing Type" itemValue="Existing Type" />
        <f:selectItem itemLabel="New Type" itemValue="New Type" />
    <h:selectOneRadio>
    
    <h:panelGroup id="myPanel" rendered="#{param['formId:someId'] == 'New Type'}">
        <h:inputText id="txtval" value="#{mybean.val}" required="true" requiredMessage="Some message">
        <h:message for="txtval" styleClass="error"/>
    <h:panelGroup>
    

    Here, I assume that the parent <h:form> has an id="formId".

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

Sidebar

Related Questions

Scenerio: I have some divs populated through foreach loop like below <div id=div1><input type=hidden
I have below scenario Got n as minimum number of rows required for the
I have a scenario like the one I described below... how can I accomplish
I have the following scenario(table below) where I would like to pick 'X' or
I have some scenario like below : /** * @ORM\Entity * @ORM\Table(name=role) */ class
In my application I have scenario like below. User downloads our application exe and
I have a scenario like below. Source Data like below (XML File):: ID CatType
Suppose I have a scenario like below : There are about 225 Computers having
I have a scenario like this: I need to pass @id to the stored
I have a scenario like this: form = MockRepository.GenerateMock<IAddAddressForm>(); mediator = new AddAddressMediator(form); The

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.