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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:10:39+00:00 2026-06-15T17:10:39+00:00

I am using jsf 2.1 + primefaces 3.4.1. I’ve got problems with preventing validation

  • 0

I am using jsf 2.1 + primefaces 3.4.1. I’ve got problems with preventing validation of disabled components.

What I have is approximately this:

<h:form id="form">
    <p:dataTable id="parentDataTable" value=#{bean.list} var="parentItem"..>
        <p:column>
          ..
          <p:dataTable id="childDataTable" value=#{bean.map[parentItem]}" var="childItem">
                <p:column>
                    <f:facet name="header">
                        some inputText
                    </f:facet>
                    <p:inputText id="inputText"
                        disabled=#{bean.selectedObjectsMap[childItem]} required="true" requiredMessage="value required" />
                    <p:message for=":form:parentDataTable:childDataTable:inputText" />
                </p:column>
                <p:column>
                    <f:facet name="header">
                        Select
                    </f:facet>
                    <p:selectBooleanCheckbox id="checkBox" value="#{bean.selectedObjectsMap[childItem]}">
                        <p:ajax update=":form:parentDataTable:childDataTable:inputText" />
                    </p:selectBooleanCheckbox>
                </p:column>
            </p:dataTable>
        </p:column>
    </p:dataTable>
</h:form>

The idea is that by default the inputText component is disabled and the “required value” validation doesn’t work when I submit the form. When I click the selectBooleancheckbox component the inputText gets enabled and the “required value” validation works as well when I submit the form. However, when I disable the inputText back the validation continues to work and the “value required” message appears and I cannot submit the form. It seems that the JSF UI component tree on the server side doesn’t properly get updated when I click on the checkbox, although visually I can see that the inputText component gets disabled every time I click on the checkbox.

Any ideas how I can resolve this?

  • 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-15T17:10:40+00:00Added an answer on June 15, 2026 at 5:10 pm

    If your validation isnt more complex than shown in this sample code, you code turn it on and off using

    <p:inputText id="inputText" disabled="#{bean.selectedObjectsMap[childItem]}" required="#{!bean.selectedObjectsMap[childItem]}" requiredMessage="value required" />
    

    Meaning you toggle required attribute with same bean value as used for disabled attribute, just add a !

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

Sidebar

Related Questions

I have implemented a login form using JSF and PrimeFaces. I used this example
I'm using this jQuery snippet to create tooltips on some JSF primefaces elements in
I am using JSF and Primefaces in my web application. In this i am
In a JSF 2.1 application, I need to build a JSF dataTable (using PrimeFaces)
i am using jsf 2.1.1 and primefaces 3.0.M4. i have a sample jsf page
I'm using JSF 2.0 and PrimeFaces library. I have a page with several inputs
I'm implementing a webapp using Jsf 2.0 and Primefaces 3.2. I've noticed this unexpected
I have a problem using JSF 2.0, PrimeFaces and the tuckey.org UrlRewriteFilter. The problem
I'm building a web-application using JSF/Primefaces. I need to have a constants-class, i.e. a
I have web application in which I am using JSF + Primefaces for UI.

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.