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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:48:12+00:00 2026-05-25T01:48:12+00:00

I searched everywhere but could not find a solution to this. I am trying

  • 0

I searched everywhere but could not find a solution to this. I am trying to used
required=yes to validate whether a value is present or not. I am using it inside inputtext.
The problem is it does not work inside a datatable. If I put the text box outside the datatable it works. I am using JSF 1.7 so I don’t have the validateRequired tag from JSF 2.0.

I even used a validator class but it is still not working. Does anyone know why does required=yes or validator=’validationClass’ inside a inputtext inside a datatable is not working.

I appreciate the help.

Thanks.

  • 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-25T01:48:13+00:00Added an answer on May 25, 2026 at 1:48 am

    First of all, the proper attribute values of the required attribute are the boolean values true or false, not a string value of Yes. It’s an attribute which accepts a boolean expression.

    The following are proper usage examples:

    <h:inputText required="true" />
    <h:inputText required="#{bean.booleanValue}" />
    <h:inputText required="#{bean.stringValue == 'Yes'}" />
    

    As to the problem that it doesn’t work inside a <h:dataTable>, that can happen when the datamodel is not been preserved properly (the datamodel is whatever the table retrieves in its value attribute). That can in turn happen when the managed bean is request scoped and doesn’t prepare the datamodel during its (post)construction which causes that the datamodel is null or empty while JSF is about to gather, convert and validate the submitted values.

    You need to ensure that the datamodel is exactly the same during the apply request values phase of the form submit request as it was during the render response phase of the initial request to display the form with the table. An easy quick test is to put the bean in the session scope. If that fixes the problem, then you definitely need to rewrite the datamodel preserving logic. You could also use Tomahawk’s <t:saveState> or <t:dataTable preserveDataModel="true"> to store the datamodel in the view scope (like as JSF2’s new view scope is doing).

    Finally, JSF 1.7 doesn’t exist. Perhaps you mean JSF 1.2?

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

Sidebar

Related Questions

i have searched for this exception everywhere but could not find a resolution &
I've searched everywhere for this, but I can't seem to find a solution. Perhaps
I've searched for this everywhere but I can't seem to find a solution; maybe
Ive searched everywhere for this but cant find the answer. I have used the
I searched everywhere but didn't find the solution. I have image 1. How can
I've searched everywhere and can't find a solution to this: I'm developing a Wordpress
I've searched for the solution for this everywhere and have not found an answer,
I have searched for hours but could not find anything similar. The crash has
I've searched everywhere but I can't seem to find a solution. I have been
I searched everywhere but can't find it. So I'm asking it here. I want

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.